mySQL的报错解决

mySQL的报错解决,第1张

1.Starting MySQL.Manager of pid-file quit without updating fi[失败]

关于这个错误原因有很多,最大的可能是没有创建测试数据库,可以用/usr/local/mysql/scripts/mysql_install_db –user=mysql命令进行创建;另外一个原因可能是权限设置问题,需要赋予mysql的data权限,可以用chmod -R 命令。

2.FATAL ERROR: Could not find /home/mysql/bin/my_print_defaults If you are using a binary release,you must run this script from

within the directory the archive extracted into. If you compiled

MySQL yourself you must run ‘make install’ first.

这个错误,是没有指明mysql的data路径导致的,可以很简单的进行解决:

vim /etc/my.cnf

在[mysqld] 后面加上路径:

basedir = /usr/local/mysql

datadir =/opt/data;

3.-bash: mysql: command not found

用mysql命令进行登陆mysql报错,原因是没有设置环境变量,需要设置,或者进入到bin目录进行登陆cd /usr/local/mysql/bin

mysql -u root

4.ERROR 1130: Host ’192.168.1.3′ is not allowed to connect to this MySQL server

用mysql远程工具链接数据库报错,这个错误原因是没有开放远程链接功能,可以在mysql里面输入如下命令进行解决:GRANT ALL PRIVILEGES ON *.* TO ’root‘@’%' IDENTIFIED BY ’password’ WITH GRANT OPTION

刚安装的mysql无法启动,提示没有权限

The innodb_system data file 'ibdata1' must be writable

[root@localhost ~]# mysqld --initialize

[root@localhost ~]# systemctl start mysqld

Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

一 无法启动mysql,可以查看mysql日志 默认路径

/var/log/mysql.log

2020-03-20T02:12:57.667801Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable

2020-03-20T02:12:57.668066Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable

2020-03-20T02:12:57.668410Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine

2020-03-20T02:12:57.668897Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.

2020-03-20T02:12:57.669159Z 0 [ERROR] [MY-010119] [Server] Aborting

mysql日志报错

根据日志查看提示, 是innodb文件没有写入权限

查找ibdata1文件路径

[root@localhost ~]# find / -name ibdata1

/var/lib/mysql/ibdata1

[root@localhost ~]# chmod -R 777 /var/lib/mysql

[root@localhost ~]# chown mysql:mysql -R /var/lib/mysql

三 接着启动服务

[root@localhost ~]# systemctl start mysqld.service

[root@localhost ~]# systemctl status mysqld.service

其他注意事项

另外注意一下mysql初始化的密码 也记录到 mysqld日志里面

[root@localhost ~]# cat /var/log/mysqld.log

2020-03-20T02:12:15.251589Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.19) initializing of server in progress as process 335

2020-03-20T02:12:19.068387Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: fyIGo9o9(t.p

2020-03-20T02:12:57.636850Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 492

[root@host]# mysqladmin -u root password "new_password"

然后可以通过以下命令来连接到Mysql服务器:

[root@host]# mysql -u root -p Enter password:*******

出现问题的时候,要多查看日志。根据日志信息能锁定问题

在centos Linux 系统下安装mysql时,执行scripts/mysql_install_db --user=mysql

报错:sh: ./bin/my print defaults: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Neither host 'guozh' nor 'localhost' could be looked up with

./bin/resolveip

Please configure the 'hostname' command to return a correct hostname.

If you want to solve this at a later stage, restart this script with the --force option

原因:mysql是32位的,而系统是64 位


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/8527040.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-17
下一篇 2023-04-17

发表评论

登录后才能评论

评论列表(0条)

保存