zoukankan      html  css  js  c++  java
  • 安装mysql5.6报错问题统计点

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

    [root@dbserver ~]# 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

    解决方法:

    [root@dbserver ~]# cd /home

    [root@dbserver home]# ls

     xiniu

    [root@dbserver home]# mkdir /home/mysql

    [root@dbserver home]# chmod 755 /home/mysql

    [root@dbserver home]# ls

    mysql   xiniu

    [root@dbserver home]# cp -a /etc/skel/. /home/mysql/

    [root@dbserver home]# su - mysql

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

    [mysql@dbserver ~]$ id

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

    报错2(启动报错)

    [root@localhost 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   ##修改成自己安装路径

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

    [root@localhost mysql]# vim /etc/my.cnf

    [root@localhost mysql]# service mysql start

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

  • 相关阅读:
    Ubuntu18.04下更改apt源为阿里云源
    sudo: pip:command not found问题解决
    CentOS8 中文输入法
    PyCharm2019 激活方式
    正则爬取京东商品信息并打包成.exe可执行程序
    学习springcloud bus+springcloud config实现刷新配置
    使用springcloud-config统一管理配置文件
    记录一下今天使用maven构建项目分多个模块时遇到的扫描properties问题
    spring+mybatis+thymeleaf
    回调地狱问题
  • 原文地址:https://www.cnblogs.com/yangzp/p/9438823.html
Copyright © 2011-2022 走看看