how can i log in to MySQL
I am new to ubuntu and installed MySQL use a rpm file,
and started it use sudo start mysql, when i try
mysqladmin -u root password testI get
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!I checked the mysqld folder and there is nothing
what can i do the next? Thanks for your answers
6 Answers
first do
sudo mysql_install_db sudo mysql_secure_installation mysql -u root -pthen enter your password
1Ubuntu doesnot use rpm it uses deb. Make sure you have installed mysql i.e.
sudo apt-get install mysql-server
It will prompt for password for root user i.e. password for your mysql root user not your system root user.
After that do
mysql -u root -p
you will be prompted for password and enter your mysql root password one you entered during mysql installation and then you are good to go.
How did you manage to install it using an rpm file??? I'm sure that you're either mistaken or definitely doing something wrong. All you needed to do is
sudo apt-get install mysql-server mysql-clientUPDATE: There seems to be MySQL 5.5 .deb file here (although the repository is for Debian) - at any rate, I think it may work better than an rpm
2There's some information in the MySQL Documentation regarding connection errors. AFAIK you will have to enable access even on localhost by modifying the bind-address config parameter: You will have to set it explicitly to 127.0.0.1 to make MySQL waiting for localhost connections. There config file should be /etc/mysql/my.conf or /etc/mysql/my.cnf
Read up on 'auth_socket'. I moved from another Linux to Ubuntu and burned a day and a half on this.
can't login as mysql user root from normal user account in ubuntu 16.04
I need to run sudo mysqladmin -u root password test to connect after doing the same steps you did, on ubuntu 18.04.
All the files under /var/lib/mysql are owned by mysql:mysql, except debian-5.7.flag which is owned by root.
I don't like this though. Could someone point out if this is harmless or how to fix it?