RedHatLinux5安装MySQL5.1.7
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了RedHatLinux5安装MySQL5.1.7,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4485字,纯文字阅读大概需要7分钟。
内容图文
RedHat Linux 5安装MySQL 5.1.7 [root@linuxidc ~]# cd /home/app/mysql[root@linuxidc mysql]# ls --解压MySQL-community-5.1.7
RedHat Linux 5安装MySQL 5.1.7
[root@linuxidc ~]# cd /home/app/mysql
[root@linuxidc mysql]# ls
--解压
MySQL-community-5.1.73-1.rhel5.i386.rpm-bundle.tar
[root@linuxidc mysql]# tar -xvf MySQL-community-5.1.73-1.rhel5.i386.rpm-bundle.tar
MySQL-test-community-5.1.73-1.rhel5.i386.rpm
MySQL-embedded-community-5.1.73-1.rhel5.i386.rpm
MySQL-devel-community-5.1.73-1.rhel5.i386.rpm
MySQL-shared-compat-5.1.73-1.rhel5.i386.rpm
MySQL-shared-community-5.1.73-1.rhel5.i386.rpm
MySQL-server-community-5.1.73-1.rhel5.i386.rpm
MySQL-client-community-5.1.73-1.rhel5.i386.rpm
MySQL-community-debuginfo-5.1.73-1.rhel5.i386.rpm
--安装
[root@linuxidc mysql]# rpm -ivh *.rpm
Preparing... ########################################### [100%]
1:MySQL-shared-community ########################################### [ 13%]
2:MySQL-devel-community ########################################### [ 25%]
3:MySQL-client-community ########################################### [ 38%]
4:MySQL-community-debugin########################################### [ 50%]
5:MySQL-embedded-communit########################################### [ 63%]
6:MySQL-server-community ########################################### [ 75%]
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 linuxidc.net 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 with the /usr/bin/mysqlbug script!
Starting MySQL..[ OK ]
Giving mysqld 2 seconds to start
7:MySQL-shared-compat ########################################### [ 88%]
8:MySQL-test-community ########################################### [100%]
--重置root密码
[root@linuxidc mysql]# /usr/bin/mysqladmin -u root -h linuxidc.net password 'root'
[root@linuxidc mysql]# /usr/bin/mysqladmin -u root password 'root'
--启动服务
[root@linuxidc mysql]# service mysql start
Starting MySQL [ OK ]
--root登录
[root@linuxidc mysql]# mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73-community 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> select now();
+---------------------+
| now() |
+---------------------+
| 2014-11-22 08:01:09 |
+---------------------+
1 row in set (0.00 sec)
--新建远程账户
mysql> GRANT ALL PRIVILEGES ON *.* TO test@localhost IDENTIFIED BY 'test' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO test@"%" IDENTIFIED BY 'test' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
--刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
--远程数据库用户登录
[root@linuxidc mysql]# mysql -utest -ptest
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.73-community 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> select now();
+---------------------+
| now() |
+---------------------+
| 2014-11-22 08:02:36 |
+---------------------+
1 row in set (0.00 sec)
mysql>
mysql> exit
Bye
[root@linuxidc mysql]# exit
logout
Last login: Sat Nov 22 07:53:02 2014 from 192.168.11.1
--copy主配置文件
[root@linuxidc ~]# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
--往主配置文件添加 skip-name-resolve,skip-grant-tables为加快远程连接
--改动mysql的配置文件,在my.cnf中的[mysqld]下面(位置不能错)加上lower_case_table_name=1这句(1表示不区分大小写,0区分大小写),,保存重新启动mysql
内容总结
以上是互联网集市为您收集整理的RedHatLinux5安装MySQL5.1.7全部内容,希望文章能够帮你解决RedHatLinux5安装MySQL5.1.7所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。