在centos上安装Mysql5.5.31的安装过程,
安装之前请删除已经安装的mysql,方法请看
http://zhenjw.iteye.com/admin/blogs/1897885
在mysql官网下的是server和client的安装文件
MySQL-server-5.5.31-2.linux2.6.x86_64.rpm
MySQL-client-5.5.31-2.linux2.6.x86_64.rpm
linux下的安装命令
rpm -ivh MySQL-server-5.5.31-2.linux2.6.x86_64.rpm MySQL-client-5.5.31-2.linux2.6.x86_64.rpm
提示安装完成后,输入mysql 看是否安装成功
mysql
[root@localhost mysql]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost mysql]# service mysql start
Starting MySQL.. SUCCESS!
[root@localhost mysql]#
[root@localhost mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.31 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
首次安装时,默认密码为空,可以使用如下命令修改root密码,
[root@localhost mysql]# mysqladmin -u root password 123456
[root@localhost mysql]# mysql -u root -p
rpm包安装的MySQL是不会安装/etc/my.cnf文件的,解决方法,只需要复制/usr/share/mysql目录下的my-huge.cnf 文件到/etc目录,并改名为my.cnf即可
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
配置远程访问
处于安全考虑,Mysql默认是不允许远程访问的,可以使用下面开启远程访问
//赋予任何主机访问数据的权限
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
//使修改生效
mysql>FLUSH PRIVILEGES;
如果依然不能远程访问的话,那就很可能防火墙的原因了,可以在防火墙中开启3306端口或者干脆关掉防火墙。
分享到:
相关推荐
linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下...
在Linux下MySQL安装配置使用指南,和网上很乱的资料不同,这是一份制作好的pdf文档,分类详细,欢迎下载。
linux下mysql安装配置
Linux下MySQL安装,rpm包、zip包都有
Linux下mysql安装步骤Linux下mysql安装步骤Linux下mysql安装步骤Linux下mysql安装步骤Linux下mysql安装步骤
Linux下MYSQL安装与卸载
linux下mysql安装、目录结构、配置
Linux下MySql安装和下载
linux下MySQL安装指南 文档为html
Linux下MySQL安装、卸载及相关操作
linux下mysql安装文件64位.版本号:MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar
linux下 mysql安装与基本用法
Linux下mysql安装配置入门知识
linux下mysql安装文件32位,版本号MySQL-5.6.22-1.el6.i686.rpm-bundle.tar
linux下mysql安装使用手册,详细说明安装过程,一步一步教会你mysql在linux下的安装。
linux下mysql安装配置.docx
一份在linux下安装mysql的操作手册