标签:ack efault for scripts 数据库 解决办法 root localhost .so
cd /
groupadd mysql
useradd -g mysql mysql
passwd mysql
chown -R mysql:mysql /usr/local
cd /usr/local/
tar -zxvf mysql5.6.tar.gz
[client]
default-character-set=utf8
socket=/usr/local/mysql/tmp/mysql.sock
[mysql]
default-character-set=utf8
[mysqld]
socket=/usr/local/mysql/tmp/mysql.sock
tmpdir=/usr/local/mysql/tmp/
max_allowed_packet=1024M
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
symbolic-links=0
character_set_server=utf8
[mysqld_safe]
default-character-set=utf8
log-error=/usr/local/mysql/logs/mysqld.log
pid-file=/usr/local/mysql/run/mysqld/mysqld.pid
chmod 777 my.cnf
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql --defaults-file=/usr/local/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/
cd /usr/local/mysql/support-files
cp mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
service mysqld start # 启动
service mysqld stop # 停止
1. 解决Access denied for user ‘‘@‘localhost‘ to database ‘mysql
原因是mysql的密码有问题
用mysql匿名用户可以进入数据库,但是看不见mysql数据库.
解决办法:
具体操作步骤:
关闭mysql:
# service mysqld stop
然后:
# mysqld_safe --skip-grant-tables
启动mysql:
# service mysqld start
mysql -u root
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD(‘xxx‘) WHERE user=‘root‘;
mysql> flush privileges;
mysql>\q
到这里密码已经修改成功,
mysql -u root -p
2. MySQL启动出现The server quit without updating PID file错误解决办法
将 /etc/mysql 下的 my.cnf 文件删除,再次启动MySQL服务
标签:ack efault for scripts 数据库 解决办法 root localhost .so
原文地址:https://www.cnblogs.com/liuliu3/p/9830207.html