问题:

MySQL安装后root用户无法连接,提示 ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password: NO)

解决:

# /etc/init.d/mysql stop 
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 
# mysql -u root mysql 
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
mysql> FLUSH PRIVILEGES; 
mysql> quit 
# /etc/init.d/mysql restart 
# mysql -uroot -p 
Enter password: <输入新设的密码newpassword>

 

问题:

操作MySQL数据库时,提示 You must SET PASSWORD before executing this statement

解决:

mysql>  SET PASSWORD = PASSWORD('123456');

 

问题:

CentOS系统安装好MySQL后,默认情况下不支持用户通过非本机连接上数据库服务器。

解决:

在mysql控制台执行

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

 

相关文章:

  • 2021-10-31
  • 2022-01-27
  • 2022-01-24
  • 2022-02-03
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-12
  • 2022-12-23
  • 2021-07-05
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案