Linux上安装完mysql需要注意的事项
安装的时候遇到密码问题处理
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
vi /root/.mysql_secret
mysql -uroot -p 随机密码
UPDATE user SET Password=PASSWORD('') where USER='root';
FLUSH PRIVILEGES;
quit;
最重要的是SET PASSWORD = PASSWORD('');
安装完mysql后,需要配置编码
一般安装完后配置文件默认在/usr/share/mysql目录下的my-medium.cnf文件;拷贝一份到/etc/下
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
show variables like 'character%';
vi /etc/my.cnf
[mysqld]
port = 3306
character-set-server=utf8
service mysql restart重启mysql服务就生效