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
111
        
4、开放远程连接
(1)你想myuser使用mypassword从任何主机连接到mysql服务器的话:

        GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

        FLUSH   PRIVILEGES;

 

5、参考
(1)linux下使用yum安装mysql
(2)设置MySQL开机自动启动的方法
(3)报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM