mysql快速入門,mysql入門經典

來源:互聯網
上載者:User

mysql快速入門,mysql入門經典



一、下載並解壓
$ wget http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-5.5.42-1.el6.x86_64.rpm-bundle.tar
解壓後得到以下幾個檔案:
$ tar -xvf MySQL-5.5.42-1.el6.x86_64.rpm-bundle.tar  
MySQL-shared-5.5.42-1.el6.x86_64.rpm
MySQL-shared-compat-5.5.42-1.el6.x86_64.rpm
MySQL-server-5.5.42-1.el6.x86_64.rpm
MySQL-devel-5.5.42-1.el6.x86_64.rpm
MySQL-test-5.5.42-1.el6.x86_64.rpm
MySQL-client-5.5.42-1.el6.x86_64.rpm
MySQL-embedded-5.5.42-1.el6.x86_64.rpm

二、安裝
1、安裝server
(1)# rpm -ivh MySQL-server-5.5.42-1.el6.x86_64.rpm

(2)若出現衝突錯誤,則是由於linux可能內建了mysql的庫,需要先將之刪除
# rpm -e mysql-libs.x86_64 --nodeps

2、安裝client
# rpm -ivh MySQL-client-5.5.42-1.el6.x86_64.rpm

三、關於設定檔
# ls *.cnf
my-huge.cnf  my-innodb-heavy-4G.cnf  my-large.cnf  my-medium.cnf  my-small.cnf
# pwd
/usr/share/mysql
使用rpm方法進行安裝時,設定檔放在/usr/share/mysql中,可根據需要放到其它地方。

四、啟動及關閉
1、方式一:命令列方式
# mysqld_safe &
# mysqladmin -uroot shutdown

2、方式二:服務方式
# service mysql start
# service mysql stop
# service mysql restart

3、串連資料庫開始使用
# 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.5.42 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.