MYSQL--安装笔记(原创)

上一篇 / 下一篇  2014-07-30 15:17:06 / 个人分类:数据库

一、上传MYSQL安装包到root目录下,并用rpm -ivh 安装
MySQL-client-5.6.13-1.rhel5.x86_64.rpm
MySQL-server-5.6.13-1.rhel5.x86_64.rpm
二、执行如下命令:
a)查询初始默认登录密码:
[root@localhost ~]#cat /root/.mysql_secret
# The random password set for the root user at Wed Jul 30 23:37:28 2014 (local time):yeZZz4e8 
b)启动MYSQL:
/etc/init.d/mysql start
c)登陆数据库并修改密码:
[root@localhost ~]#mysql -u root -p
Enter password:yeZZz4e8 
----------------------------------------------------------------
mysql>SET PASSWORD = PASSWORD('123456');    --修改密码
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye
d)设置远程连接配置
[root@localhost ~]#mysql -u root -p
Enter password:123456
mysql>use mysql;    --连接数据库
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>update user set host='%' where user='root' and host='localhost';   --设置任何主机都可以连接此数据库
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> exit
Bye
f)重启MYSQL就可以远程客户端工具连接使用了;
/etc/init.d/mysql restart

FAQ1:有时会出现安装完成,客户端连接不上server的情况;关闭防火墙即可
[root@localhost init.d]# /etc/init.d/iptables stop
Flushing firewall rules: [  OK  ]
Setting chains to policy ACCEPT: filter [  OK  ]
Unloading iptables modules: [  OK  ]



TAG:

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-05  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 2886
  • 日志数: 6
  • 建立时间: 2014-07-30
  • 更新时间: 2014-08-04

RSS订阅

Open Toolbar