1、MySQL数据库在CentOS 6.8环境下的安装;
2、MySQL root用户忘记密码的修改方法;
3、MySQL常用SQL语句的用法。
检查本地YUM中可用的与mysql相关的软件包
[root@hadoop00 ~]# yum list | grep mysql
出现如图所示错误,需要重新挂载一下系统安装镜像
[root@hadoop00 ~]# mount -o loop /root/CentOS-6.8-x86_64-bin-DVD1.iso /mnt/centos
[root@hadoop00 ~]# mount
[root@hadoop00 ~]# yum list | grep mysql
?[root@hadoop00 ~]# yum install -y mysql-server mysql mysql-devel
[root@hadoop00 ~]# service mysqld start
[root@hadoop00 ~]# mysqladmin -u root password '000000'
[root@hadoop00 ~]# mysql -uroot -p000000
查看字符编码
mysql> show variables like "%char%";
复制配置文件模板为/etc/my.cfg
[root@hadoop00 ~]# cp /usr/share/doc/mysql-server-5.1.73/my-large.cnf /etc/my.cnf
[root@hadoop00 ~]# vi /etc/my.cnf
添加如下配置
重启mysqld服务
[root@hadoop00 ~]# service mysqld restart
Stopping mysqld:?????????????????????????????????????????? [? OK? ]
Starting mysqld:?????????????????????????????????????????? [? OK? ]