CentOS-minimal 6.5 安装mysql
来源:互联网 发布:wireshark过滤端口抓包 编辑:程序博客网 时间:2024/04/25 12:23
CentOS-minimal 6.5 安装mysql
之前写了一个在Ubuntu上使用离线包安装mysql的过程,相较于CentOS来说稍微麻烦点,因为mysql提供了rpm安装包。
在安装之前,我们先把所需的安装包下载下来,使用的版本还是5.5.45,与Ubuntu离线包的区别是,这里我们要下载三个安装包,下载链接如下:
http://cdn.mysql.com/archives/mysql-5.5/MySQL-server-5.5.45-1.linux2.6.x86_64.rpm
http://cdn.mysql.com/archives/mysql-5.5/MySQL-client-5.5.45-1.linux2.6.x86_64.rpm
http://cdn.mysql.com/archives/mysql-5.5/MySQL-devel-5.5.45-1.linux2.6.x86_64.rpm
这里还是建议使用迅雷下载(我真不是来打广告的),下载完成后待用。
- 首先,我使用的CentOS是minimal6.5版本的,查看是否安装了mysql:
[root@qiuxiao ~]# rpm -qa | grep mysql mysql-libs-5.1.71-1.el6.x86_64
- 此版本默认安装了mysql-libs(其他版本我也看过了,安装的更多),先把它卸载掉,否则后面安装不了:
[root@qiuxiao ~]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64
- 在安装之前先安装一个依赖包,mysql运行的时候会用到这个依赖包,否则运行不了:
[root@qiuxiao ~]# yum install libaio
- 安装mysql,安装顺序如下(别忘了先上传到CentOS上,我是上传到/usr/local/目录下),注意输出的信息,会用到的:
[root@qiuxiao local]# rpm -ivh MySQL-server-5.5.45-1.linux2.6.x86_64.rpm warning: MySQL-server-5.5.45-1.linux2.6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:MySQL-server ########################################### [100%] 151020 19:14:16 [Note] /usr/sbin/mysqld (mysqld 5.5.45) starting as process 1240 ... 151020 19:14:16 [Note] /usr/sbin/mysqld (mysqld 5.5.45) starting as process 1247 ... 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 qiuxiao 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 at http://bugs.mysql.com/ [root@qiuxiao local]# rpm -ivh MySQL-client-5.5.45-1.linux2.6.x86_64.rpm warning: MySQL-client-5.5.45-1.linux2.6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:MySQL-client ########################################### [100%] [root@qiuxiao local]# rpm -ivh MySQL-devel-5.5.45-1.linux2.6.x86_64.rpm warning: MySQL-devel-5.5.45-1.linux2.6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:MySQL-devel ########################################### [100%]
- 启动mysql服务:
[root@qiuxiao local]# service mysql start Starting MySQL.. SUCCESS!
- 修改root密码:
[root@qiuxiao local]# /usr/bin/mysqladmin -u root password 'new password'
登录mysql:
[root@qiuxiao local]# mysql -u root -pEnter password:
设置字符集
1)查询字符集:mysql> show variables like'character%';
2)修改字符集:
mysql> SET character_set_database = utf8;Query OK, 0 rows affected (0.00 sec)mysql> SET character_set_server = utf8;Query OK, 0 rows affected (0.00 sec)
设置root用户可以远程连接(以下两种任选其一)
1)从所有主机:mysql> grant all privileges on *.* to root@"%" identified by"root用户的密码"with grant option;Query OK, 0 rows affected (0.00 sec)
2)从指定主机:
mysql> grant all privileges on *.* to root@"192.168.11.205" identified by"root用户的密码"with grant option; flush privileges;Query OK, 0 rows affected (0.00 sec)
重启mysql服务
[root@qiuxiao ~]# service mysql restart Shutting down MySQL... SUCCESS! Starting MySQL.. SUCCESS!
防火墙开放mysql端口3306
1)开放3306端口:[root@qiuxiao ~]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
2)保存:
[root@qiuxiao ~]# /etc/rc.d/init.d/iptables saveiptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
3)重启防火墙:
[root@qiuxiao ~]# /etc/init.d/iptables restartiptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Flushing firewall rules: [ OK ]iptables: Unloading modules: [ OK ]iptables: Applying firewall rules: [ OK ]
Navicat连接mysql
由图可知,连接成功!
2 0
- CentOS-minimal 6.5 安装mysql
- CentOS 6.5-minimal 安装与配置LAMP
- CentOS minimal 安装笔记
- CentOS minimal 安装笔记
- centos minimal 安装步骤
- centos minimal 安装
- centos minimal 安装体验
- Minimal CentOS安装VMwareTools
- VMware 安装 CentOS 安装 CentOS-6.5-i386-minimal.iso 版本
- CentOS-6.4-minimal版中源码安装MySQL-5.5.38
- CentOS-6.4-minimal版中源码安装MySQL-5.5.38
- 源码安装mysql-5.7.17(centos-6.8-minimal)
- 源码安装mysql-5.7.17(centos-6.8-minimal)
- 在VMware上安装CentOS-6.5 minimal - 安装VMware Tools
- CentOS 6.x minimal 安装
- CentOS-6.4-minimal安装记录
- centos 6.3 minimal 安装jdk
- 安装CentOS-6.3-i386-minimal
- 图像处理之应用篇-大米计数续
- hook对应的汇编码0x8B, 0xFF,0x55,0x8B, 0xEC, // mov ebp,esp
- 错误1error LNK2019: 无法解析的外部符号 __imp____glutInitWithExit@12,该符号在函数 _glutInit_ATEXIT_HACK@8 中被引用D:\C+
- 图像处理之添加高斯与泊松噪声
- diamond types are not supported at this language level
- CentOS-minimal 6.5 安装mysql
- spring aop的案例(二)缓存配置
- 异常情况下Activity生命周期分析
- C#: 向Word插入排版精良的Text Box
- AndroidUI-TxetView嵌套Html的使用
- POJ2488 dfs回溯
- 最全的常用正则表达式大全——包括校验数字、字符、一些特殊的需求等等
- Oracle 组件 系列 小结
- FragmentTransaction管理 Activity中 fragment的替换