mysql常见问题解决方法.
1. 问题:mysql启动报错(linux)
[root@localhost ~]# service mysqld restart
Another MySQL daemon already running with the same unix socket.
Starting mysqld: [FAILED]
解决方法:
[root@localhost ~] mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
[root@localhost ~]# service mysqld restart
2. 问题:navicat连接mysql:报1130错误(windons)
1130: Host xxx.xxx.xxx.xxx is not allowedto connect to this MySQL server
解决方法:
mysql>use mysql
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;
mysql>select 'host','user' from user where user='root';
mysql>quit
3. 问题: navicat连接mysql:报1045错误
1045 Access denied for user 'root'@'localhost' (using password:YES)
解决方法:
/etc/init.d/mysqld stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root';
(UPDATE user SET Password=PASSWORD('123456') where USER='root' and host='root' or host='localhost';)
mysql> FLUSH PRIVILEGES;
mysql> quit
/etc/init.d/mysqld restart
4. 问题: navicat连接mysql:报10060错误
Can't connect to MySQL server (10060)
解决方法:
http://database.51cto.com/art/201107/274565.htm(重点检查3306端口是否已经开放)
5. 问题:如何创建其他账号远程连接mysql服务器
mysql>use
mysql
mysql>GRANT ALL PRIVILEGES ON *.* TO 'sems_mysql'@'%' IDENTIFIED BY 'gziscassems' WITH GRANT OPTION;
6. 问题: navicat连接mysql:报10061错误
2003- can.t connect to MySQL server on xxx.xxx.xxx.xxx (10061)
解决方法:
启动mysql服务
[root@centos64 ~]# service mysqld start
7 问题:navicat连接mysql:报ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
/etc/init.d/mysqld
stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> delete from user where USER='';
mysql> FLUSH PRIVILEGES;//记得要这句话,否则如果关闭先前的终端,又会出现原来的错误
mysql> quit
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!