您的位置:首页技术文章
文章详情页

非root安装MySQL5.6报错,求助!!!

【字号: 日期:2022-06-14 16:34:05浏览:19作者:猪猪

问题描述

安装时运行

./scripts/mysql_install_db --defaults-file=/home/gzwangweihao/local/mysql/my.cnf -user=gzwangweihao --basedir=/home/gzwangweihao/local/mysql --datadir=/home/gzwangweihao/local/mysql/data --socket=/home/gzwangweihao/tmp/mysql.sock

./bin/mysqld_safe --defaults-file=/home/gzwangweihao/local/mysql/my.cnf --sock=/home/gzwangweihao/tmp/mysql.sock --user=gzwangweihao &

指定了sock等路径安装完毕后,运行

查看33306端口mysqld再执行。然后

./bin/mysqladmin -u gzwangweihao password ’123456’ -P33306

报错

./bin/mysqladmin: connect to server at ’localhost’ failed error: ’Can’t connect to local MySQL server through socket ’/var/run/mysqld/mysqld.sock’ (2)’Check that mysqld is running and that the socket: ’/var/run/mysqld/mysqld.sock’ exists!

配置文件如下:

basedir = /home/gzwangweihao/local/mysqldatadir = /home/gzwangweihao/local/mysql/dataport = 33306socket = /home/gzwangweihao/tmp/mysql.sock

求助是哪里出了问题啊,感激不尽

问题解答

回答1:

log很清晰啊,sock不能用,是不是之前装过了?

相关文章: