The process is quite simple once you know the trick 🙂

  1. Make a copy of the web site folder structure
  2. Create yourself another folder at the root with the name of your Dev site
  3. Paste the content of the Live one we made into that new folder
  4. Make an export of the MySQL Database in SQL format, i love using “HeidiSQL” it’s easy and friendly use,
  5. Open the SQL file with a Text editor and locate those 2 lines :
  6. Replace the value between the quote by the name of the new staging database
  7. In your favorite MySQL manager, create a new database with the same name with new credential as well
  8. Inject the SQL Script in the new Database
  9. In the new folder , locate the file wp_config.php and open it with your favorite text editor
  10. Modify the file to reflect the new credential and database name you’ve setup
  11. Back into your favorite MySQL manager, run the following Query to update the URL of the wordpress installation

update wp_options
set option_value = REPLACE(option_value,'','')
where option_value like ''

Tagged with:  


Tagged with:  

First we need to have access to MySQL server , then with the query analyzer we have to pass the following 3 query, dont forget to change “DATABASENAME” to your database and the info in the “VALUE” section to adap to your need !


INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘4’, ‘demo’, MD5(‘demo’), ‘Your Name’, ‘’, ‘’, ‘2011-06-07 00:00:00’, ”, ‘0’, ‘Your Name’);


INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4','wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');


INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4','wp_user_level', '10');

Ref :

Tagged with:  

How to install Mysql on Ubuntu Server

On 22 April 2015, in Mysql, Ubuntu, by Himselff
  • sudo apt-get install mysql-server
  • mysql -uroot -p
    • Enter the password
  • grant all on *.* to “root”@”%” identified by “ThePasswordHere” with grant option;
  • exit
  • sudo nano /etc/mysql/my.cnf
  • Modify the line where it says listen to , with your IP
Tagged with:  

MySQL Query to extract database size

On 11 December 2013, in IT Procedure, Mysql, Programming, by Himselff
SELECT table_schema , sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;
Tagged with:  
  • grant all on *.* to ‘root’@’%’ identified by ‘PasswordHere’ with grant option;
Tagged with:  

How to connect to Mysql server with command line

On 3 September 2013, in Mysql, by Himselff
  • mysql –server=serverIP –user=monuser –password=monpassword
Tagged with:  

How to reset root password on mysql server

On 26 April 2011, in Mysql, by Himselff

1. Stop MySQL services

2.  Start them back in safe mode (mysqld_safe –skip-grant-tables &)

3. mysql -u root mysql

4. At the prompt, run the following command, changing abcd by your new password :

UPDATE user SET password=PASSWORD(“abcd”) WHERE user=”root”;

5. There you go , just enter that command to test, it will prompt for the password :

mysql -uroot -p

Tagged with:  

How to install Mysql server on Fedora

On 19 April 2011, in Fedora, Linux, Mysql, by Himselff

In terminal :

1. yum install mysql mysql-server (launch the install)

2. chkconfig mysqld on (Make the deamon start at boot)

3. service mysqld start (launch the deamon)

4. mysqladmin -u root password ‘new-password’ (Setting the root password, don’t forger the quote)

Tagged with: