标签:nec info ext2 bsp roo arch linu 输入 下载
#CentOS7的yum源中默认好像是没有mysql
cd /usr/local
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-server mysql-devel -y
查看mysql状态启动及停止
service mysqld status
service mysqld start
service mysqld stop
vim /etc/my.cnf
skip-grant-tables #[mysqld] 部分,skip-grant-tables添加 保存退出
重启mysql服务
service mysqld restart
mysql -uroot -p #进入mysql中,此时不需要输入密码就可以登陆
mysql>show databases; mysql>use mysql; mysql>UPDATE user SET password=PASSWORD(‘123456‘) WHERE user=‘root‘; mysql>FLUSH PRIVILEGES; mysql>QUIT
1.6 修改/etc/my.conf配置文件
将之前更改的配置文件/etc/my.cnf中的 skip-grant-tables 删除
service mysqld restart
修改/etc/my.cnf配置文件,在[mysqld]下添加编码配置,如下所示:
[mysqld]
character_set_server=utf8
init_connect=‘SET NAMES utf8‘
登录mysql执行命令:
mysql> show variables LIKE ‘%CHARACTER%‘;
标签:nec info ext2 bsp roo arch linu 输入 下载
原文地址:https://www.cnblogs.com/boye169/p/14843305.html