CentOS 5.5下RPM方式安裝MySQL 5.5 詳解

來源:互聯網
上載者:User

#rpm –qa|grep –i mysql查看已安裝的mysql版本

如果有已存在的mysql版本則刪除

安裝服務端和用戶端,去Oracle官網下載:

# rpm -ivh MySQL-server-5.5.28-1.linux2.6.i386.rpm

# rpm -ivh MySQL-client-5.5.28-1.linux2.6.i386.rpm

安裝後會出現以下資訊,提示不要忘記設計root使用者的密碼以及其他資訊。

之後查看mysql的服務是否啟動#netstat -nat

如看到有3306的連接埠號碼,就說明服務啟動了,預設的連接埠是3306 ,如果沒有啟動的話 ,就開啟服務 #service mysql start  啟動mysql服務。

然後再輸入mysql,若出現以下提示資訊,說明成功。

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, 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資料庫後:mysql>use mysql;

然後查看一下root的情況select user,password form user;

修改密碼update user set password=password(‘newpassword’)where user=’root’ and host=’root’ or host=’localhost’;

至此mysql是安裝成功了的。

但是遠端存取還是不行的,還有兩個地方,第一是資料庫設定,第二是防火牆。一般資料庫已經是可以直接連接成功的了。只是沒有ROOT許可權,如果連不上,像我這樣的,肯定是被防火牆擋住了。

資料庫的MYSQL表中控制的可來訪的許可權,因此我們要改一下它,這樣我們就有ROOT許可權了。

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.