欢迎来到天天文库
浏览记录
ID:42625162
大小:112.37 KB
页数:4页
时间:2019-09-19
《linux下mysql_rpm安装》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、环境:Redhat5.5MySQL-client-5.6.14-1.rhel5.i386.rpmMySQL-server-5.6.14-1.rhel5.i386.rpmMySQL-shared-5.6.14-1.rhel5.i386.rpm1、查看MySQL及相关RPM包,是否安装:[root@localhost~]#rpm-qa
2、grep-imysqlmysql-libs-5.1.66-2.el6_3.x86_64[root@localhost~]#yum-yremovemysql-libs*2、下载Linux对应的RPM包,如
3、:CentOS6.4_64对应的RPM包,如下:MySQL-client-5.6.15-1.el6.x86_64.rpmMySQL-devel-5.6.15-1.el6.x86_64.rpmMySQL-server-5.6.15-1.el6.x86_64.rpm或:MySQL-client-5.6.14-1.rhel5.i386.rpmMySQL-server-5.6.14-1.rhel5.i386.rpmMySQL-shared-5.6.14-1.rhel5.i386.rpm3、安装MySQLrpm-ivhMySQL-*#修改配
4、置文件位置[root@localhostrpm]#cp/usr/share/mysql/my-default.cnf/etc/my.cnf4、初始化MySQL及设置密码[root@localhostrpm]#/usr/bin/mysql_install_db[root@localhostrpm]#servicemysqlstart[root@localhostrpm]#cat/root/.mysql_secret #查看root账号密码#TherandompasswordsetfortherootuseratSunMay109:1
5、9:382016(localtime):Cb34wy5w[root@localhost~]#mysql-uroot–pqKTaFZnlmysql>SETPASSWORD=PASSWORD('123456'); #设置密码为123456mysql> exit[root@localhost~]#mysql-uroot-p1234565、允许远程登陆mysql>usemysql;mysql> select host,user,passwordfromuser;mysql>updateuser set password=passwo
6、rd('123456')whereuser='root';mysql>updateuser set host='%' whereuser='root' andhost='localhost';mysql>flushprivileges;mysql> exit6、设置开机自启动[root@localhost~]#chkconfigmysqlon[root@localhost~]#chkconfig--list
7、grepmysqlmysql 0:off 1:off 2:on 3:on 4:on 5:on 6:
8、off7、MySQL的默认安装位置/var/lib/mysql/ #数据库目录/usr/share/mysql #配置文件目录/usr/bin #相关命令目录/etc/init.d/mysql #启动脚本8、修改字符集和数据存储路径配置/etc/my.cnf文件,修改数据存放路径、mysql.sock路径以及默认编码utf-8.[client]password=123456port=3306default-cha
9、racter-set=utf8[mysqld]port=3306character_set_server=utf8character_set_client=utf8collation-server=utf8_general_ci#(注意linux下mysql安装完后是默认:表名区分大小写,列名不区分大小写;0:区分大小写,1:不区分大小写)lower_case_table_names=1#(设置最大连接数,默认为151,MySQL服务器允许的最大连接数16384;)max_connections=1000[mysql]defaul
10、t-character-set=utf89、查看字符集showvariableslike'%collation%';showvariableslike'%char%';查看防火墙状态:serviceiptablesstatus查看防火墙状态serv
此文档下载收益归作者所有