评论

收藏

[MySQL] MySQL Study之--Mysql启动失败“mysql.host”

数据库 数据库 发布于:2021-07-03 21:44 | 阅读数:338 | 评论:0

MySQL Study之--Mysql启动失败“mysql.host”

  
系统环境
操作系统:RedHat EL55
DB Soft:  Mysql 5.6.4-m7
  

  通过源码包安装mysql后,在启动mysqld时出现错误:
  [root@rh55 mysql]# bin/mysqld_safe &
[1] 15846
[root@rh55 mysql]# 150610 17:04:36 mysqld_safe Logging to '/usr/local/mysql/data/mysql/rh55.err'.
150610 17:04:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/mysql
150610 17:04:37 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql/rh55.pid ended

[1]+  Done                    bin/mysqld_safe

  

  查看mysql日志:
  
[root@rh55 mysql]# more /usr/local/mysql/data/mysql/rh55.err
  查看mysql配置文件:
[root@rh55 ~]# cat /etc/my.cnf
[mysqld]  
port      = 3306  
socket      = /tmp/mysql.sock  
skip-external-locking  
key_buffer_size = 16M  
max_allowed_packet = 1M  
table_open_cache = 64  
sort_buffer_size = 512K  
net_buffer_length = 8K  
read_buffer_size = 256K  
read_rnd_buffer_size = 512K  
myisam_sort_buffer_size = 8M  
datadir=/usr/local/mysql/data/mysql
  解决方案:
[root@rh55 mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql
  
启动mysql server:

[root@rh55 mysql]# bin/mysqld_safe &
[1] 16199
[root@rh55 mysql]# 150610 17:08:22 mysqld_safe Logging to '/usr/local/mysql/data/mysql/rh55.err'.
150610 17:08:22 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/mysql

验证启动成功:
[root@rh55 mysql]# netstat -an |grep 3306
tcp        0      0 :::3306                     :::*                        LISTEN  
  


  
关注下面的标签,发现更多相似文章