ubuntu mysql install and modify the password

sudo apt-get install mysql-server

sudo apt-get install mysql-client

sudo apt-get install libmysqlclient-dev

File: /etc/mysql/debian.cnf database record is created when the initial accounts, use this logon

error: 'Access denied for user 'root'@'localhost' (using password: YES)'解决办法:

/etc/init.d/ MySQL STOP # Stop mysql or service mysql stop

su root

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

This step # error: mysqld_safe Directory '/ var / run / mysqld' for UNIX socket file do not exists

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

mysql - U root mysql mysql interactive mode to enter #

SET user authentication_string Update = PASSWORD ( " your_psswrd " ) WHERE user = ' the root ' ; #mysql passwords are stored in the user table of the mysql directly updates the user table
update user set plugin="mysql_native_password";

flush privileges; # update authority

quit;

MySQL -u root -p # sign back

When apt to install the software, the emergence of hash checksum does not match the problem, hotspot network into a good school network, the operator looks like a problem?

Guess you like

Origin www.cnblogs.com/zxy1122/p/12031035.html