Installing MySQL on Fedora 17/18
Password:
[root@ranga ranga]#
mysql.x86_64 5.5.33-1.fc17.remi remi
mysql-server.x86_64 5.5.33-1.fc17.remi remi
[root@ranga ranga]#
--------------------------------------------------------
--------------------------------------------------------
Dependency Updated:
mysql-devel.x86_64 0:5.5.33-1.fc17.remi mysql-libs.x86_64 0:5.5.33-1.fc17.remi
Complete!
Step5: Start the MySQL server and autostart MySQL on boot
[root@ranga ranga]# systemctl enable mysqld.service
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/multi-user.target.wants/mysqld.service'
- Set (Change) root password(Mandatory)
- Remove anonymous users(Optional)
- Disallow root login remotely(Optional)
- Remove test database and access to it(Optional)
- Reload privilege tables(Optional)
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] n
... skipping.
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.33 MySQL Community Server (GPL) by Remi
Copyright (c) 2000, 2013, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| ranga |
| test |
+--------------------+
5 rows in set (0.00 sec)
mysql>
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
+-------+-----------+-------------------------------------------+
| user | host | password |
+-------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | ranga | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | 127.0.0.1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | ::1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| | localhost | |
| | ranga | |
| ranga | % | *446F5A1568CCBD4237563DD8AF67580D8CF5AAA9 |
+-------+-----------+-------------------------------------------+
7 rows in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 1 row affected (0.00 sec)
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | ranga | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | 127.0.0.1 | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root | ::1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| | localhost | |
| | ranga | |
+------+-----------+-------------------------------------------+
6 rows in set (0.00 sec)
Query OK, 2 rows affected (0.00 sec)
mysql> select user, host, password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | ranga | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | 127.0.0.1 | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root | ::1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+------+-----------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql>
Bye
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Stopping MySQL database server: mysqld.[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started
[root@ranga ranga]# mysql -u rootWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>mysql> update user set password=PASSWORD("root") where User='root';
mysql> flush privileges;
mysql> quit
[root@ranga ranga]# /etc/init.d/mysql stopStopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
Done mysqld_safe --skip-grant-tables[root@ranga ranga]# /etc/init.d/mysql start[root@ranga ranga]# mysql -u root -p UnInstall the MySQL:Step1: [root@ranga ~]# rpm -qa | grep mysqlmysql-server-5.5.33-1.fc17.remi.x86_64
mysql-libs-5.5.33-1.fc17.remi.x86_64
mysql-devel-5.5.33-1.fc17.remi.x86_64
mysql-5.5.33-1.fc17.remi.x86_64Step2: Remove the all packages that come out of the query above.Note: You can tell RPM to ignore dependencies and just rip stuff out with the --nodeps flag. [root@ranga ~]# rpm -e mysql-5.5.33-1.fc17.remi.x86_64 --nodeps
[root@ranga ~]# rpm -qa | grep mysql
mysql-server-5.5.33-1.fc17.remi.x86_64
mysql-libs-5.5.33-1.fc17.remi.x86_64
mysql-devel-5.5.33-1.fc17.remi.x86_64[root@ranga ~]# rpm -e mysql-server-5.5.33-1.fc17.remi.x86_64 --nodeps
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
[root@ranga ~]# rpm -e mysql-libs-5.5.33-1.fc17.remi.x86_64 --nodeps
[root@ranga ~]# rpm -e mysql-devel-5.5.33-1.fc17.remi.x86_64 --nodeps
[root@ranga ~]# rpm -qa | grep mysql
[root@ranga ~]# In your system MySQL is successfully Uninstalled........Another Trick to un install is rpm -qa|grep <thing you want to uninstall> | xargs rpm -erpm -qa|grep mysql | xargs rpm -eSimplest way of un install is System tools --> Add/Remove Application then looks for SQL and check MySQL to remove from the system.Thanks for Reading this article.................