RHE5 -- 安装Mysql5

下载下来:
-rw-r--r-- 1 root root 7635229 Jul 30 07:38 MySQL-client-community-5.1.49-1.rhel5.i386.rpm
-rw-r--r-- 1 root root 21277185 Jul 30 07:38 MySQL-server-community-5.1.49-1.rhel5.i386.rpm

动工了:
# rpm -ivh MySQL-server-community-5.1.49-1.rhel5.i386.rpm

# rpm -ivh MySQL-client-community-5.1.49-1.rhel5.i386.rpm

启动:
# /etc/init.d/mysql start
Starting MySQL [ OK ]

重启:
# /etc/init.d/mysql restart
Shutting down MySQL.... [ OK ]
Starting MySQL. [ OK ]

关掉:
# /usr/bin/mysqladmin -u root -p shutdown
Enter password:

登录授权:
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'lake'@'%'IDENTIFIED BY 'lake' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
# mysql -ulake -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

远程登录(再执行一次授权):
mysql> GRANT ALL PRIVILEGES ON *.* TO 'lake'@'%'IDENTIFIED BY 'lake' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> Ctrl-C -- exit!
# mysql -u lake -h 192.168.116.129 -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

开放端口:
# vim /etc/sysconfig/iptable
有没有看到:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
这就是开放22端口
意思意思:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

修改密码:
mysql> update user set password = PASSWORD("12345") where user='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 3 Changed: 0 Warnings: 0

mysql> commit;
Query OK, 0 rows affected (0.00 sec)
# /etc/init.d/mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]

好像还有些什么,忘记,以后再补
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值