Previous |
Home | Next |
Versions: | - mysql-server 5.0.21 - mysql-administrator 1.1.6 - phpMyAdmin-2.8.1 |
Order: |
File
Location: |
Description: |
1. |
/etc/my.cnf | For setting global options |
2. |
/var/lib/mysql/my.cnf | For setting server-specific options |
3. |
~/my.cnf | For setting user-specific options (if applicable) |
Sample
File: |
Used
For: |
my-huge.cnf | Large site, fully dedicated mysql
server, 1-2GB RAM |
my-large.cnf | Large site, mostly dedicated mysql
server, ~512MB RAM |
my-medium.cnf | Medium site, shared server running
mysql,
> 64MB RAM |
my-small.cnf | Small site, shared server running
mysql, < 64MB RAM |
File Locations: /usr/share/doc/mysql-server-?.??.?? |
[bash]# cp /etc/my.cnf /etc/my.cnf.original [bash]# cp /usr/share/doc/mysql-server-?.??.??/my-small.cnf /var/lib/mysql/my.cnf |
Copy the sample file that best suits your system and
requirements. A configuration that is over tuned for your system may
waste resources unnecessarily. |
[bash]# chkconfig
--level 345 mysqld on [bash]# chkconfig --list mysqld |
[bash]# /etc/init.d/mysqld
restart [bash]# tail /var/log/mysqld.log |
[bash]# ls -l /var/lib/mysql |
drwx------ 2 mysql mysql 4096 Dec 22 04:41 mysql srwxrwxrwx 1 mysql mysql 0 Dec 22 04:41 mysql.sock drwx------ 2 mysql mysql 4096 Dec 22 04:41 test |
[bash]# mysqlcheck -A |
mysql.columns_priv
OK mysql.db OK . . *** Output Trimmed *** . mysql.time_zone_transition_type OK mysql.user OK |
[bash]# /etc/init.d/mysqld restart |
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! galaxy mysql_install_db: This is done with: galaxy mysql_install_db: /usr/bin/mysqladmin -u root password 'new-password' galaxy mysql_install_db: /usr/bin/mysqladmin -u root -h galaxy.example.com password 'new-password' galaxy mysql_install_db: See the manual for more instructions. |
[bash]# mysql -u root |
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD(' NEW_ROOT_PASSWORD <-- change MySQL root passwordmysql> SET PASSWORD FOR 'root'@'galaxy.example.com' NEW_ROOT_PASSWORD <-- change MySQL root passwordmysql> quit |
Now Need: "-u
root -p" |
[bash]# mysqladmin -u root -p variables Enter password: |
[bash]# echo "select USER,HOST,PASSWORD from user" | mysql -u root -p -D mysql Enter password: |
USER HOST PASSWORD root localhost 31218f0c48d3e60f root galaxy.example.com 31218f0c48d3e60f galaxy.example.com localhost pma localhost 3cf4e95402cfe1cd <-- added duing phpMyAdmin config |
[bash]# yum install mysql-admin* mysql-gui* |
[bash]# mysql-administrator & <-- To execute GUI administrator |
[bash]# tar -xzvf phpMyAdmin-?.?.?.tar.gz
-C /var/www/ [bash]# chown -R root.root /var/www/phpMyAdmin-?.?.? |
Replace phpMyAdmin-?.?.?
with the version number that you are installing. |
[bash]# vi /var/www/phpMyAdmin-?.?.?/config.inc.php |
<?php $cfg['PmaAbsoluteUri'] = 'https://www.example.com/mysql'; $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE; $cfg['PmaNoRelation_DisableWarning'] = FALSE; $cfg['blowfish_secret'] = ''; /* Start of servers configuration */ $i = 0; /* Server localhost (config:root) [1] */ $i++; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = '/var/lib/mysql/mysql.sock'; $cfg['Servers'][$i]['connect_type'] = 'socket'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'NEW_ROOT_PASSWORD'; <-- change MySQL root password $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['controluser'] = 'pma'; $cfg['Servers'][$i]['controlpass'] = 'PMA_PASSWORD'; <-- change PMA password $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; /* End of servers configuration */ ?> |
Replace "PMA_PASSWORD"
and "NEW_ROOT_PASSWORD"
with the appropriate passwords for those accounts. |
[bash]# mysqladmin -u root -p version |
Server version 5.0.21 |
WARNING>>>>
ONLY FOR SQL VERSIONS ABOVE
4.1.2 [bash]# mysql -u root -p < /var/www/phpMyAdmin-?.?.?/scripts/create_tables_mysql_4_1_2+.sql |
[bash]# ls -l /var/lib/mysql/ |
drwx------ 2 mysql mysql 4096 Dec 22 02:50 mysql srwxrwxrwx 1 mysql mysql 0 Dec 22 06:02 mysql.sock drwx------ 2 mysql mysql 4096 Dec 22 06:17 phpmyadmin drwx------ 2 mysql mysql 4096 Dec 22 02:50 test |
WARNING>>>>
ONLY FOR SQL VERSIONS ABOVE
4.1.2 [bash]# mysql -u root -p mysql> _ |
|
GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'PMA_PASSWORD'; <-- change PMA password GRANT SELECT ( Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv ) ON mysql.user TO 'pma'@'localhost'; GRANT SELECT ON mysql.db TO 'pma'@'localhost'; GRANT SELECT ON mysql.host TO 'pma'@'localhost'; GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO 'pma'@'localhost'; quit |
Replace "PMA_PASSWORD"
with the appropriate password for the pma control account. |
[bash]# vi /etc/httpd/conf.d/phpMyAdmin.conf |
Alias /mysql "/var/www/phpMyAdmin-?.?.?" <Location "/mysql"> AuthType Basic AuthName "Private Area - MySQL Administrator" AuthUserFile /etc/httpd/conf/authusers AuthGroupFile /etc/httpd/conf/authgroups Require group sqlusers # Require valid-user </Location> |
[bash]# vi /etc/httpd/conf.d/mod-rewrite.conf |
RewriteRule ^/mysql/(.*) https://%{SERVER_NAME}/mysql/$1 [R,L] |
[bash]# /etc/init.d/httpd restart |
Previous |
Home | Next |