03 Juni
2011

MySQL First Step Installation On RHEL 5

  1. Install mysql rpm packages
    $ yum install mysql-server mysql-connector-odbc MySQL-python \
    	libdbi-dbd-mysql perl-DBD-MySQL php-mysql php-bcmath \
    	php-cli php-dba php-gd php-imap php-ldap php-mbstring \
    	php-snmp php-xml php-xmlrpc php php-soap mod_ssl
    
  2. Removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
    $ mysql_secure_installation
    
  3. Set root user password for the first time
    $ mysqladmin -u root password 'p455w0rd.0'
    $ mysqladmin -u root -h host1.winston.web.id password 'p455w0rd.0'
    $ mysqladmin -u winston password 'p455w0rd.1'
    $ mysqladmin -u winston -h host1.winston.web.id password 'p455w0rd.1'
    
  4. Create Database
    $ mysqladmin -u root -p create wordpres
    password:
    
  5. Create User
    $ mysql -u root -pp455w0rd.0 mysql
    $ mysql -u winston -pp455w0rd.1 mysql
    mysql> SELECT host, user from mysql.user;
    mysql> CREATE USER 'winston'@'localhost' IDENTIFIED BY 'p455w0rd.0';
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'winston'@'localhost' \
    						WITH GRANT OPTION;
    mysql> CREATE USER 'winston'@'%' IDENTIFIED BY 'p455w0rd.0';
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'winston'@'%' WITH GRANT OPTION;
    mysql> GRANT RELOAD,PROCESS ON *.* TO 'winston'@'localhost';
    mysql> GRANT RELOAD,PROCESS ON *.* TO 'winston'@'%';
    mysql> CREATE USER 'admin'@'localhost';
    mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
    mysql> CREATE USER 'dummy'@'localhost';
    
  6. Delete User
    $ mysql -u winston -pp455w0rd.1
    mysql> DELETE FROM mysql.user WHERE user='dummy' AND host='localhost';
    
  7. Drop Database
    $ mysql -u winston -pp455w0rd.1
    mysql> DROP DATABASE db_wordpress;
    
  8. Create Database
    $ mysql -u winston -pp455w0rd.1
    mysql> CREATE DATABASE db_wordpress;
    

Di Terbitkan Oleh Winston Sahusilawane Pada Rubrik Linux : 03 Juni, 2011 |