How to install mysql server on fedora
1) First of all install mysql client and server. Open the terminal and enter the following command
[jasonleon]$ yum install mysql mysql-server2) Then Install the mysql package and start the mysql deamon by using the command
[jasonleon]$ service mysqld start3)Start the mysql deamon everytime you boot
[jasonleon]$ chkconfig --level 2345 mysqld on4) Login as root database admin to MYSQL server
[jasonleon]$ mysql -u root5) Change the database password by using
[jasonleon]$ mysqladmin -u root password NEWPASSWORDIf you want to change or update the new password you can use the following command
[jasonleon]$ mysqladmin -u root -p OLDPASSWORD password NEWPASSWORDSimilary, you can change the password of other users
[jasonleon]mysqladmin -u username -p OLDPASSWORD password NEWPASSWORDYou can also change the password using mysql commands
Login to mysql server by typing following command at shell prompt
[jasonleon]$ mysql -u root -p6) If you have anonymous access to the database consider removing it.
mysql> use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='username';
mysql> reload privileges
mysql> FLUSH priviledges
mysql> DELETE FROM user where User='';7) Add new users with database admin priviledges for all the databases
mysql> FLUSH PRIVILEGES
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
No comments:
Post a Comment