Linux系统上安装MySQL

安装MySQL

卸载自带mysql

查询mysql的安装情况,可以直接使用了

rpm -qa | grep -i mysql –-color

卸载原生的MySQL

rpm -e --nodeps mysql-libs-5.1.71-1.el6.i686

上传mysql到Linux

CRT远程连接软件中:alt+p 拖拽上传即可

安装依赖(准备阶段已经安装过了)

yum -y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6

yum  update libstdc++-4.4.7-4.el6.x86_64

安装mysql的服务端

安装服务端

rpm -ivh MySQL-server-5.5.49-1.linux2.6.i386.rpm

默认安装在usr目录中

[root@yejing ~]# rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm

Preparing...                ########################################### [100%]

   1:MySQL-server           ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h yejing password 'new-password'

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

Starting MySQL....[确定]

[root@yejing ~]#

安装mysql的客户端

rpm -ivh MySQL-client-5.5.49-1.linux2.6.i386.rpm

[root@yejing ~]# rpm -ivh MySQL-client-5.1.73-1.glibc23.i386.rpm

Preparing...                ########################################### [100%]

   1:MySQL-client           ########################################### [100%]

[root@yejing ~]#


启动mysql的服务

启动MySQL服务

service mysql start

设置mysql初始密码并登陆MySQL

/usr/bin/mysqladmin -u root password '123456'

设置开机自动启动mysql

加入到系统服务:

chkconfig --add mysql

自动启动(关闭):

chkconfig mysql on/off

开启远程服务

登录mysql:

//赋予root用户所有权限,远程登录密码是123456

grant all privileges on *.* to 'root' @'%' identified by '123456';

flush privileges;//刷新权限

设置Linux的防火墙

Linux防火墙默认拦截3306端口

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT//将3306端口进行防火墙的开启

/etc/rc.d/init.d/iptables save//防火墙重新刷新保存

[root@yejing ~]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

[root@yejing ~]# /etc/rc.d/init.d/iptables save

iptables:将防火墙规则保存到 /etc/sysconfig/iptables:[确定]

最新文章

  1. 关于Unicode,字符集,字符编码,每个程序员都应该知道的事
  2. C/C++ 双精度double 数据相加出错缺陷解释
  3. ACM/ICPC 之 Dinic算法(POJ2112)
  4. Android中View的事件分发机制
  5. 0006 《SQL必知必会》笔记02-计算字段与函数
  6. ajax“显示弹窗详情”和“删除”功能练习
  7. 【PHP设计模式 09_ZhuangShiQi.php】装饰器模式 (decorator)
  8. js中的apply和call API
  9. vmware workstation 12 安装windows7 网卡不能安装驱动的问题
  10. JNDI--Java命名和目录接口
  11. [Swust OJ 217]--Factor(数论,类素数表)
  12. C#中System.Globalization.DateTimeFormatInfo.InvariantInfo怎么用
  13. hdu_2825_Wireless Password(AC自动机+状压DP)
  14. java linux ImageIO 验证码在一段时间以后出不来 问题总结
  15. 【Maven】---坐标与依赖
  16. 【转】联普多WAN口路由器是否可以设置叠加带宽
  17. CF401D Roman and Numbers
  18. C++中 int i 与 int &i 注意事项
  19. mongodb 按配置文件mongodb.conf启动
  20. js 数组 转为树形结构

热门文章

  1. [redis] redis连接远程客户端查询数据
  2. HashMap的长度为什么要是2的n次方
  3. Numpy 用于数组的文件输入和输出
  4. 第三百八十七节,Django+Xadmin打造上线标准的在线教育平台—网站上传资源的配置与显示
  5. Lamp后端开发技能表v0.1(转)
  6. Java如何以短格式显示月份?
  7. c、c++---linux上的GetTickCount函数
  8. linux -- "./configure --prefix "命令
  9. 初识ZooKeeper与集群搭建实例
  10. 阿里云Redis开发规范[转]