MySQL阿里云安装问题小记

1.

[root@iZ2zeg11g0cdei5171kqskZ mysql]# ./scripts/mysql_install_db --user=mysql
FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:
Data::Dumper

解决

yum -y install autoconf

2.

[root@iZ2zeg11g0cdei5171kqskZ mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

解决:

yum -y install libaio-devel

3

[root@iZ2zeg11g0cdei5171kqskZ mysql]# service mysqld start
Starting MySQL.touch: cannot touch '/var/log/mariadb/mariadb.log': No such file or directory
chmod: cannot access '/var/log/mariadb/mariadb.log': No such file or directory
touch: cannot touch '/var/log/mariadb/mariadb.log': No such file or directory
chown: cannot access '/var/log/mariadb/mariadb.log': No such file or directory
/usr/local/mysql//bin/mysqld_safe: line 129: /var/log/mariadb/mariadb.log: No such file or directory
/usr/local/mysql//bin/mysqld_safe: line 166: /var/log/mariadb/mariadb.log: No such file or directory
touch: cannot touch '/var/log/mariadb/mariadb.log': No such file or directory
chown: cannot access '/var/log/mariadb/mariadb.log': No such file or directory
chmod: cannot access '/var/log/mariadb/mariadb.log': No such file or directory
/usr/local/mysql//bin/mysqld_safe: line 129: /var/log/mariadb/mariadb.log: No such file or directory
The server quit without updating PID file (/var/lib/mysql/i[FAILED]0cdei5171kqskZ.pid).

解决:(我们确实是没有/var/log/mariadb/mariadb.log 这个目录,这个是因为你没有指定他的配置文件的话,他会默认找到/etc/my.cnf 这个配置文件,因为我们修改了mysql的数据存储目录)

rm -f /etc/my.cnf

4.

[root@iZ2zeg11g0cdei5171kqskZ mysql]# mysql -uroot -p
-bash: mysql: command not found

解决:(这个是因为/usr/local/bin目录下缺失mysql导致,只需要一下方法建立软链接,即可以解决)

 ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

5 安装教程: mysql centos安装教程

posted @ 2017-11-10 15:38  xd_net2016  阅读(417)  评论(0编辑  收藏  举报