1.用Navicat連接配接虛拟機下的mysql出現問題: 2003- Can't connect MySQL Server on '192.168.*.*'(10038).
解決方案:
方法:直接授權(推薦)
從任何主機上使用root使用者,密碼:youpassword(你的root密碼)連接配接到mysql伺服器:
# mysql -u root -proot
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
2. 由于操作錯誤,再次登入出現問題:“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)”。
1、跳過密碼進行登入
修改mysql配置檔案 在[mysqld]的段中加上兩句:
skip-name-resolve
skip-grant-tables
2. 登入mysql,修改密碼
/usr/bin/mysql登入mysql
use mysql ;
update mysql.user set authentication_string=password('root') where user='root';
flush privileges;
quit
3. 重新開機mysql服務
service mysql restart