Archive for category Tuto
Recover MySQL root password
You can recover MySQL database server password with following five easy steps.
Step # 1: Stop the MySQL server process.
Step # 2: Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password
Step # 3: Connect to mysql server as the root user
Step # 4: Setup new root password
Step # 5: Exit and restart MySQL server
Here are commands you need to type for each step (login as the root user):
Step # 1 : Stop mysql service
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld.
Step # 2: Start to MySQL server w/o password:
# mysqld_safe --skip-grant-tables &
Output:
[1] 5988 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6025]: started
Step # 3: Connect to mysql server using mysql client:
# mysql -u root
Output:
Welcome 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>
Step # 4: Setup new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Step # 5: Stop MySQL Server:
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld STOPPING server from pid file /var/run/mysqld/mysqld.pid mysqld_safe[6186]: ended [1]+ Done mysqld_safe --skip-grant-tables
Step # 6: Start MySQL server and test it
# /etc/init.d/mysql start
# mysql -u root -p
How to install phpMyAdmin – 2.11.3 on CentOS 5.
- $ su -
- # cd /var/www/html
- # wget -c http://prdownloads.sourceforge.net/phpmyadmin/
phpMyAdmin-2.11.3-english.tar.gz?download - # tar xvfz phpMyAdmin-2.11.3-english.tar.gz
- # mv phpMyAdmin-2.11.3-english phpmyadmin
- # cd phpmyadmin
- # cp config.sample.inc.php config.inc.php
- # vi config.inc.php
:
$cfg['Servers'][$i]['auth_type'] = ‘http‘; # default is cookies
: - # service httpd restart
You can test by open phpmyadmin by this link :
http://your.domain.com/phpmyadmin/
You should be find pop up for insert your user name and password.
Install PHPMyAdmin on Centos 5 Server
PHPMyAdmin
Download and install the latest stable release of phpMyAdmin. At the time of writing this is 3.0.0
[root@cyber ~]# cd /usr/src/
[root@cyber src]wget http://internode.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-3.0.0-all-languages.tar.gz
tar -xzf phpMyAdmin-3.0.0-all-languages.tar.gz
mv /usr/src/phpMyAdmin-3.0.0-all-languages /var/www/html/phpMyAdmin
cd /var/www/html/phpMyAdmin
cp config.sample.inc.php config.inc.php
Next we need to configure phpMyAdmin to use the MySQL user and password specified earlier. (we’ll jump straight in at line 30)
vim +30 config.inc.php
change line 30 to read:
$cfg['Servers'][$i]['auth_type'] = ‘config’;
$cfg['Servers'][$i]['user'] = ‘root’;
$cfg['Servers'][$i]['password'] = ‘mypassword’;
vim +326 /etc/httpd/conf/httpd.conf
/etc/init.d/httpd restart
vim /var/www/html/phpMyAdmin/.htaccess
Insert the following text:
AuthName "phpMyAdmin"
AuthType Basic
AuthUserFile /var/www/html/phpMyAdmin/.htpasswd
AuthGroupFile /dev/null
require user MySQLAdmin
htpasswd -c /var/www/html/phpMyAdmin/.htpasswd MySQLAdmin
PhpInfo
phpInfo gives a handy output of installed options,versions and cofig of your LAMP server
mkdir /var/www/html/phpInfo
vi /var/www/html/phpInfo/index.php
<?php
phpinfo();
?>
Save the file.
phpInfo can be viewed by browsing to http://yourdomain.com/phpInfo