安装mysql5.6报错问题统计点

Posted 西瓜君~

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装mysql5.6报错问题统计点相关的知识,希望对你有一定的参考价值。

报错1su进入mysql属组时报错):

[[email protected] ~]# su - mysql

Last login: Thu Aug 31 17:20:03 CST 2017 on pts/1

su: warning: cannot change directory to /home/mysql: No such file or directory

-bash-4.2$ exit

解决方法:

[[email protected] ~]# cd /home

[[email protected] home]# ls

 xiniu

[[email protected] home]# mkdir /home/mysql

[[email protected] home]# chmod 755 /home/mysql

[[email protected] home]# ls

mysql   xiniu

[[email protected] home]# cp -a /etc/skel/. /home/mysql/

[[email protected] home]# su - mysql

Last login: Thu Aug 31 17:20:58 CST 2017 on pts/1

[[email protected] ~]$ id

uid=987(mysql) gid=1003(mysql) =1003(mysql) 环境=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

 

报错2(启动报错)

[[email protected] mysql]# /etc/init.d/mysql start

Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).

解决方法:

#rm -rf /usr/local/mysql/data

# chown -R mysql.mysql .

# cd  /usr/local/mysql

# scripts/mysql_install_db

# /usr/local/mysql/bin/mysqld_safe --user=root &

# ls    /usr/local/mysql/data/

# /etc/init.d/mysqld start
Starting MySQL SUCCESS!   ##启动成功

 

报错3(启动报错)

/etc/init.d/mysql: line 256: my_print_defaults: command not found

/etc/init.d/mysql: line 276: cd: /usr/local/mysql: No such file or directory

Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)

解决办法:
编辑/etc/my.cnf 文件,因为缺少basedir  datadir 两个路径,在 [mysqld] 添加上即可
#vim /etc/my.cnf
[mysqld]
...........
...........
basedir=/usr/local/mysql          ##修改成自己安装路径
datadir=/usr/local/mysql/data   ##修改成自己安装路径

保存退出,然后重新启动就可以.

[[email protected] mysql]# vim /etc/my.cnf

[[email protected] mysql]# service mysql start

Starting MySQL........................................ SUCCESS!









以上是关于安装mysql5.6报错问题统计点的主要内容,如果未能解决你的问题,请参考以下文章

编译安装mysql5.6.29及安装报错的解决方法

eclipse在jsp界面上的第一行出现了报错,点报错的地方出现了这个,怎么回事?需要啥?

阿里云CentOS7安装MySQL5.7报错GPG校验不正确

二进制安装mysql5.6.39报错找不到libnuma.so.1库文件

centos6.5 安装mysql5.6

mysql5.6插入中文字段报错解决