ubuntu14.04安裝MySQL

來源:互聯網
上載者:User

標籤:

      今天開始安裝MySQL,本來是去官網下載安裝包來安裝的,但是安裝之後卻不能用,預計是要配置吧,在網上搜了非常多的資料,結果還是失敗。所以僅僅好在軟體源中安裝,這樣就省去非常多不必要的麻煩了。
[email protected]:~$ sudo apt-get install mysql-server[sudo] password for zhiniaobu:

運行該命令後,系統還會自己主動安裝其他的一些軟體,在安裝過程中會提示輸入mysql的登入password。

假設系統版本號碼不一樣,提示的方式可能不一樣,只是整體來說都差點兒相同。安裝好後,運行命令

[email protected]:~$ mysqlERROR 1045 (28000): Access denied for user 'zhiniaobu'@'localhost' (using password: NO)[email protected]:~$ 
結果出現錯誤,Google了半天,結果越來越沒耐心,這時候翻了翻自己買的書籍,輸入了以下的命令
[email protected]:~$ mysql -uroot -pmysql
當中 第一個mysql是命令, -uroot是指定使用者為root, -pmysql是輸入登入password,第二個mysql是password,假設你設定的password是別的,就換成自己安裝時設定的password,切記 password和-p之間 不要有空格,不然會失敗的。以下是我成功登入後,查看當前全部存在的資料庫。
[email protected]:~$ mysql -uroot -pmysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 61Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || performance_schema |+--------------------+3 rows in set (0.00 sec)mysql> 

ubuntu14.04安裝MySQL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.