下载下来:
-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 ]
好像还有些什么,忘记,以后再补
-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 ]
好像还有些什么,忘记,以后再补
本文详细介绍了如何在Linux环境下下载、安装MySQL 5.1社区版,并完成基本配置,包括启动、重启、关闭服务,创建用户并授予权限,远程连接及修改密码等操作。
1414

被折叠的 条评论
为什么被折叠?



