首页/应用软件/内容

centos 6.9安装mysql的案例图文详细教程

应用软件2023-04-28 阅读()
12 MB 00:05 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mysql-libs-5.1.73-8.el6_8.x86_64 1/5 Installing : perl-DBI-1.609-4.el6.x86_64 2/5 Installing : perl-DBD-MySQL-4.013-3.el6.x86_64 3/5 Installing : mysql-5.1.73-8.el6_8.x86_64 4/5 Installing : mysql-server-5.1.73-8.el6_8.x86_64 5/5 Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 1/5 Verifying : mysql-libs-5.1.73-8.el6_8.x86_64 2/5 Verifying : mysql-server-5.1.73-8.el6_8.x86_64 3/5 Verifying : mysql-5.1.73-8.el6_8.x86_64 4/5 Verifying : perl-DBI-1.609-4.el6.x86_64 5/5 Installed: mysql-server.x86_64 0:5.1.73-8.el6_8 Dependency Installed: mysql.x86_64 0:5.1.73-8.el6_8 mysql-libs.x86_64 0:5.1.73-8.el6_8 perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6 Complete!

7、启动mysql服务

[root@cdh1 zjl]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

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 cdh1.zjl.com password 'new-password'Alternatively you can run:/usr/bin/mysql_secure_installationwhich 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.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!   [  OK  ]
Starting mysqld:                                           [  OK  ]

8、连接一下试一下,直接mysql然后\q关闭连接

[root@cdh1 zjl]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2Server version: 5.1.73 Source distribution

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> \q
Bye

9、设置mysql开机启动

[root@cdh1 zjl]# chkconfig mysqld on

10、开启3306端口,并保存

[root@cdh1 zjl]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
[root@cdh1 zjl]# /etc/rc.d/init.d/iptables save

11、连接mysql设置密码

[root@cdh1 zjl]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3Server version: 5.1.73 Source distribution

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> 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 password=password('123') where user='root';
Query OK, 3 rows affected (0.02 sec)
Rows matched: 3  Changed: 3  Warnings: 0mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

mysql> \q
Bye

12、重启mysql服务

[root@cdh1 zjl]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

以上就是centos 6.9安装mysql的实例教程的详细内容,更多请关注php中文网其它相关文章!

  • 微信

  • 学习教程快速掌握从入门到精通的SQL知识。



    第1页  第2页  第3页  第4页  第5页  第6页  第7页 

    ……

    标签:centos 6.9安装mysql的案例图文详细教程
    相关阅读