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