這篇文章主要為大家展示了“如何在線安裝MySQL”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“如何在線安裝Mysql”這篇文章吧。
專注于為中小企業(yè)提供做網(wǎng)站、成都網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)南皮免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了上千余家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
[bigdata@bigdata-pro02 ~]$ rpm -qa | grep mysql mysql-libs-5.1.73-3.el6_5.x86_64
如果檢查存在一些安裝包,則使用 rpm -e --nodeps [安裝包1] [安裝包2] [...] 將已有的安裝包卸載。
這里需要切換到root用戶
[root@bigdata-pro02 ~]# rpm -e --nodeps mysql-libs-5.1.73-3.el6_5.x86_64 [root@bigdata-pro02 ~]#
使用yum list | grep mysql 來檢查可以使用的安裝包
[root@bigdata-pro02 ~]# yum list | grep mysql-server mysql-server.x86_64 5.1.73-8.el6_8 @base
[root@bigdata-pro02 ~]# yum install mysql-server.x86_64 -y Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile epel/metalink | 4.9 kB 00:00 * base: mirrors.163.com * epel: mirrors.ustc.edu.cn * extras: mirrors.163.com * updates: mirrors.163.com base | 3.7 kB 00:00 epel | 3.2 kB 00:00 epel/primary | 3.2 MB 00:01 epel 12521/12521 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 1.2 MB 00:00 Resolving Dependencies --> Running transaction check ---> Package mysql-server.x86_64 0:5.1.73-8.el6_8 will be installed --> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64 --> Running transaction check ---> Package mysql.x86_64 0:5.1.73-8.el6_8 will be installed ---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be installed ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed ---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================== Package Arch Version Repository Size ==================================================================================================================== Installing: mysql-server x86_64 5.1.73-8.el6_8 base 8.6 M Installing for dependencies: mysql x86_64 5.1.73-8.el6_8 base 895 k mysql-libs x86_64 5.1.73-8.el6_8 base 1.2 M perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k perl-DBI x86_64 1.609-4.el6 base 705 k Transaction Summary ==================================================================================================================== Install 5 Package(s) Total download size: 12 M Installed size: 33 M Is this ok [y/N]: y Downloading Packages: (1/5): mysql-5.1.73-8.el6_8.x86_64.rpm | 895 kB 00:00 (2/5): mysql-libs-5.1.73-8.el6_8.x86_64.rpm | 1.2 MB 00:00 (3/5): mysql-server-5.1.73-8.el6_8.x86_64.rpm | 8.6 MB 00:03 (4/5): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm | 134 kB 00:00 (5/5): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:00 -------------------------------------------------------------------------------------------------------------------- Total 2.4 MB/s | 12 MB 00:04 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. ** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows: 2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit) 2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit) 2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of mysql-libs 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!
檢查系統(tǒng)中是否安裝mysql
[root@bigdata-pro02 ~]# rpm -qa | grep mysql mysql-5.1.73-8.el6_8.x86_64 mysql-libs-5.1.73-8.el6_8.x86_64 mysql-server-5.1.73-8.el6_8.x86_64
檢查mysql命令所在位置
[root@bigdata-pro02 ~]# which mysql /usr/bin/mysql
[root@bigdata-pro02 ~]# service mysqld status mysqld is stopped [root@bigdata-pro02 ~]# 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 bigdata-pro02.mars.com password 'new-password' **# 以上為兩種新建root用戶并設(shè)置密碼的方式** 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. 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 ]
添加root用戶并設(shè)置密碼
[root@bigdata-pro02 ~]# /usr/bin/mysqladmin -u root password '123456'
登錄mysql數(shù)據(jù)庫
[root@bigdata-pro02 ~]# mysql -uroot -p123456 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server 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> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.00 sec) mysql> use test; Database changed mysql> show tables; Empty set (0.01 sec) mysql> create table test1 (id int(10), name varchar(20) ) ; Query OK, 0 rows affected (0.00 sec) mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | test1 | +----------------+ 1 row in set (0.00 sec)
以上是“如何在線安裝Mysql”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)頁標(biāo)題:如何在線安裝Mysql
文章網(wǎng)址:http://bm7419.com/article26/pceecg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、品牌網(wǎng)站制作、云服務(wù)器、網(wǎng)站制作、響應(yīng)式網(wǎng)站、營銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)