程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> 關於MYSQL數據庫 >> How to install mysql server on fedora

How to install mysql server on fedora

編輯:關於MYSQL數據庫

This howto will guide you on how to install MySQL 5 on your fedora, start the mySQL Server on reboot, make new MySQL users, change root and user's passWord and add new database, remove anonymous logins and give permissions to different users.

1) First of all install MySQL clIEnt and server. Open the terminal and enter the following command

[jasonleon]$ yum install mysql MySQL-server

2) Then Install the mysql package and start the MySQL deamon by using the command

[jasonleon]$ service MySQLd start

3)Start the MySQL deamon everytime you boot

[jasonleon]$ chkconfig --level 2345 MySQLd on

4) Login as root database admin to MYSQL Server

[jasonleon]$ MySQL -u root

5) Change the database passWord by using

[jasonleon]$ MySQLadmin -u root password NEWPASSWord

If you want to change or update the new passWord you can use the following command

[jasonleon]$ MySQLadmin -u root -p OLDPASSWORD password NEWPASSWord

Similary, you can change the passWord of other users

[jasonleon]MySQLadmin -u username -p OLDPASSWORD password NEWPASSWord

You can also change the passWord using MySQL commands

Login to mySQL Server by typing following command at shell prompt

[jasonleon]$ MySQL -u root -p

mysql> use MySQL;

MySQL> update user set password=PASSWORD("NEWPASSWord") where User='username';

MySQL> reload privileges

MySQL> FLUSH priviledges

6) If you have anonymous Access to the database consider removing it.

MySQL> DELETE FROM user where User='';

MySQL> FLUSH PRIVILEGES

7) Add new users with database admin priviledges for all the databases

MySQL> GRANT ALL PRIVILEGES ON *.* TO 'user' @'localhost' INDENTIFIED BY 'somepass' WITH GRANT OPTION;

8) We can also add permissions to a user for a specific database.

MySQL> GRANT SELECT, INSERT, UPDATE, CREATE, DROP, INDEX, ALTER ON some_database.* TO 'user'@'localhost';

9) Add a new MySQL database

MySQL> create database db_name;

10) If you want to manage your database through a graphical user interface you can use mysql-administrator. Install MySQL-administrator tool when installed you can find it in Application => System Tools.

[jasonleon]$ yum install MySQL-administrator

How to install mysql server on fedora

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved