my.conf
[mysqld]
datadir=/var/lib/mysql/mysql
socket=/var/lib/mysql/mysql.sock
[mysqld@1]
socket = /var/run/mysqld/mysqld1.sock
datadir = /var/lib/mysql/mysql1
我可以mysql -u root -p
连接,但当我想连接到mysql --socket=/var/run/mysqld/mysqld1.sock -u root -p
之类的第二个实例时,我有ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
。我多次检查密码是否正确。
centos 7
答案 0 :(得分:1)
我只需要使用mysqladmin --socket=path_to_socket -u root -p'temporary password from logs' password new_password