redhat下mysql安装与使用
1、安装
(1)查看是否安装
yum list installed mysql*
(2)查看现有安装包
yum list mysql*
(3)安装mysql服务器端
yum install mysql-dev
yum install mysql-server
(4)安装mysql客户端(可选)
yum install mysql
2、配置
(1)设置默认字符和引擎
vim /etc/my.cnf
在[mysqld]下添加
default-character-set=utf8
default-storage-engine=INNODB
3、启动和关闭
(1)启动和关闭
/etc/init.d/mysqld start
/etc/init.d/mysqld stop
(2)开机启动
/sbin/chkconfig - - list
/sbin/chkconfig add mysqld
/sbin/chkconfig mysqld on
4、开放远程连接
(1)你想myuser使用mypassword从任何主机连接到mysql服务器的话:
GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@’%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/7478.html