MySQL5.7.23安装-报错问题摘录
-
目录结构规划如下
[root@myown_test my3307]# pwd
/data/my3307
其实 basedir就是所有文件的父目录

[root@myown_test my3308]# ls -ltr
总用量 28
drwxr-xr-x 2 mysql mysql 4096 8月 24 10:58 bin --存放可执行文件
drwxrwxr-x 3 mysql mysql 4096 8月 24 14:57 srv --存放建库的文件
drwxrwxr-x 5 mysql mysql 4096 8月 24 15:48 data --存放对应的数据文件
drwxrwxr-x 4 mysql mysql 4096 8月 24 15:48 log --存放相关的日志
drwxrwxr-x 2 mysql mysql 4096 8月 24 15:48 tmp --存放对应的临时文件
drwxrwxr-x 2 mysql mysql 4096 8月 24 15:48 run --存放相关的socket文件和 pid文件
[root@myown_test my3307]# mkdir -p /data/my3308/srv/share/






-
以下为安装过程
[root@myown_test mysql]# cd /data/mysql
[root@myown_test mysql]# bin/mysqld --initialize --user=mysql --datadir=/data/my3308/data --basedir=/data/my3308/srv 必须到bin文件的父目录执行哦
-
以下附带安装过程的一些报错和解决方法
报错1
2018-08-24T07:00:28.546052Z 0 [Warning] InnoDB: Ignoring tablespace `mysql/servers` because it could not be opened.
2018-08-24T07:00:28.546077Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2018-08-24T07:00:28.546092Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2018-08-24T07:00:28.546105Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2018-08-24T07:00:28.546118Z 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/slave_master_info.ibd' OS error: 71
2018-08-24T07:00:28.546132Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2018-08-24T07:00:28.546144Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2018-08-24T07:00:28.546157Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2018-08-24T07:00:28.546171Z 0 [ERROR] InnoDB: Could not find a valid tablespace file for `mysql/slave_master_info`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
解决方法:清空以下目录 如:
/data/my3308/log/log binlog
/data/my3308/log/iblog 亲测有效
|
报错2
[root@myown_test mysql]# service mysqld start
Starting MySQLCouldn't find MySQL server (/data/my3308/srv/bin/mysqld_safe)[失败]
srv目录是建库之后那些可执行文件的存放目录,报错没有对应的 可执行文件,从安装介质中拷贝即可
|
报错3
-bash-4.1$ mysql -h 127.0.0.1 -u root
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
[root@myown_test mysql]# mysql -u root -h localhost
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/my3309/run/mysql.sock' (2)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
my.cnf文件中添加如下信息,注意重启:
skip-grant-tables
原因2 本地的网络问题 导致 localhost 和 127.0.0.1 无法正确解析
|
创建时间:2021-12-22 12:05
넶浏览量:0