mysql5.6移动目录以后无法启动
rpm方式安装的,安装后移动了目录,改了my.cnf文件,也改了/etc/rc.d/init.d/mysql里面的路径,结果service mysql start能启动,却无法连接,在/etc/rc.d/init.d/mysql路径下直接mysql start无法启动。
数据库路径已经改到我自定义的目录,但是启动的时候还是提示默认的那个安装路。
很奇怪的现象,当使用service mysql start启动数据库后,使用mysql -u 用户名 -p -S 自定义的新路径,这样登陆是OK的,因为指定了sock文件的路径,但是mysql -u 用户名 -p就无法登陆,提示找不到sock,提示的那个路径是原来的默认安装路径。
想请问下大家谁碰到过这种情况?
不要跟我说my.cnf里面client和mysqld下面修改soket路径,5.6的跟以前的不一样,只有mysqld,没有client,而且mysqld的soket我已经配置好了,不然service mysql start也不能启动。
下面是5.6的cnf配置文件:
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
datadir = /home/mysql
port = 3306
server_id = 1
socket = /home/mysql/mysql.sock
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES