How to create MySQL cPanel on Phpmyadmin
Hi all,
I tried creating new database direct on phymyadmin without success. Google search informed me that it needs creating MySQL cPanel on Phpmyadmin. But I couldn't figure out how to do it. Please help. TIA satimis |
Quote:
You want to create a cpanel database or what exactly? Are you installing cpanel/Whm? Code:
create database cpanel; Is Phpmyadmin setup correctly/installed? You have root shell access or is this shared hosting? We need way more info than " Google search informed me that it needs creating MySQL cPanel on Phpmyadmin" http://forums.cpanel.net/f5/unable-c...in-183431.html |
3 Attachment(s)
Quote:
Thanks for your advice. I'm administrator. I was following below article cloning live website on Godday to local server; How to Clone Your Live WordPress Blog to a Local Server http://www.maketecheasier.com/clone-...-local-server/ I can't find a way creating new database as described on the article. phpmyadmin, aparche2 and MySQL are running. I can ran MySQL commands on terminal creating new database. The live website has been exported from phpmyadmin on Godaddy server to local server. Followings are the screenshots of local phpmyadmin. Screenshot_20140107_01.png Highlight – information_schema Screenshot_20140107_info_schema.png Highlight – test Screenshot_20140107_test.png Highligh -wordpress Screenshot_20140107_wordpress.png (on next posting because only 3 files allowed) On highting "test" -> Import (download database - "__DB__.sql.zip" Warning: Code:
Error Rgds satimis |
1 Attachment(s)
Highligh -wordpress
Screenshot_20140107_wordpress.png |
Quote:
Try backup up and restoring only your wordpress database. |
1 Attachment(s)
Quote:
On phpmyadmin (Godaddy server) Export Following items are checked as default [check] SQL Structure [check] Add AUTO_INCREMENT value [check] Enclose table and field names with backquotes Data [check] Use hexadecimal for BLOB According to the article:- How to Clone Your Live WordPress Blog to a Local Server http://www.maketecheasier.com/clone-...-local-server/ [check] zipped (see attached file) Whether I made any mistake? Thanks satimis |
Quote:
|
2 Attachment(s)
Quote:
(see Screenshot_unselect_all.png) Select only the database - sat1318107320909 -> Export -> import error (see Screenshot_error_sat1318.png) satimis |
Quote:
Or, run the import as "root" |
Quote:
Code:
Database export options Quote:
Code:
$ mysql -u root -p Quote:
Code:
$ mysql -u root -p Quote:
Warning: Code:
Error Quote:
Edit ==== I got it. Login phpmyadmin as root with MySQL root password Code:
Import has been successfully finished, 389 queries executed. (__DB__.sql.zip) Rgds satimis |
Quote:
unzip the __DB__.sql.zip file, you only need the .sql inside it... Code:
root@localhost:~ # mysql wordpress < /path/to/file.sql Code:
mysql -usat1318107320909 -ppassword <enter> |
2 Attachment(s)
Quote:
satimis@mint16ssd00 ~ $ cd Downloads/ satimis@mint16ssd00 ~/Downloads $ ls Code:
__DB__.sql.zip Code:
Archive: __DB__.sql.zip Code:
__DB__.sql Password: mint16ssd00 Downloads # mysql wordpress < /home/satimis/Downloads/__DB__.sql Code:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Login phpmyadmin as user - wordpress the import database not showing up see Screenshot_phpmyadmin_wordpress.png Login phpmyadmin as root the import database showing up see Screenshot_phpmyadmin_root.png On browser http://localhost/wordpress/wp-login.php Error establishing a database connection satimis |
I would guess that your actual wordpress data is in the sat1318107320909 database as there is the "create" statement in your .sql file, I'm also guessing that there's a use sat1318107320909 in there that loads all the data into that database instead of the one you specify on the command line.
Give your wordpress@localhost user permissions on the sat1318107320909 database and use that as the database name in your wordpress config. |
Quote:
mysql> show databases; Code:
+--------------------+ Code:
mysql> USE sat1318107320909; Thanks satimis |
Quote:
|
Quote:
Code:
Reading table information for completion of table and column names Code:
ERROR 1396 (HY000): Operation CREATE USER failed for 'wordpress'@'localhost' Edit: Sorted out the problem as follow; mysql> DROP user wordpress@localhost; Query OK, 0 rows affected (0.00 sec) mysql> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY "password"; Query OK, 0 rows affected (0.01 sec) mysql> GRANT ALL ON sat1318107320909.* TO wordpress@localhost; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye http://localhost/wordpress/ Error establishing a database connection http://localhost/wordpress/wp-login.php Error establishing a database connection Still the same satimis |
no need to create the user, just use
Code:
grant all on sat1318107320909.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; exit; Do not change database! The privileges are held in mysql.user Code:
use mysql; then test using Code:
mysql -usat1318107320909 -p<password> <enter> edit wp-config.php and adjust the Code:
define('DB_NAME', 'sat1318107320909'); |
Quote:
How to change the WordPress site URL using MySQL command line http://www.lanexa.net/2011/08/how-to...-command-line/ $ mysql -u root -p mysql> USE sat1318107320909; mysql> SHOW tables; Code:
+--------------------------------+ Code:
Empty set (0.02 sec) satimis |
Quote:
Code:
select * from wp_options where option_id = '1'; Code:
http://piano-04.satimis.com/wordpress You could update it with this: Code:
use sat1318107320909; update wp_options set option_value = 'http://localhost/' where option_id = 1 ; but if it is under|below /var/www/html/ (say /var/www/html/wordpress) then I'd use: Code:
sat1318107320909 ; update wp_options set option_value = 'http://localhost/wordpress' where option_id = 1 ; |
Hi Habitual,
mysql> USE sat1318107320909 Code:
Reading table information for completion of table and column names Code:
+-----------+-------------+-----------------------------+----------+ Code:
Query OK, 1 row affected (0.01 sec) Code:
/localhost/wordpress/ Code:
WordPress has been updated! Before we send you on your way, we have to update your database to the newest version. Code:
Update Complete Login to the website. Lot of thanks for your assistance !!! It is rather tricky to copy/clone/mirror the Live WordPress website to local server. There are many suggestions/articles on Internet in this respect. Which of them can work? We have to test them. Fortunately I make this test on VM. If failure I just clone another VM on the original VM and start another test. I'll write down all steps and post the same here later for the benefit of other readers. I already start another test on; Copy your WordPress site to a local server for development and testing http://handcoded.ca/copy-your-wordpr...-local-server/ It uses "WP Migrate DB"-WordPress Plugin to export the DB. Also I have encountered problem. I'll start another posting. Rgds satimis |
So it's working now?
Warning: <opinion> Any tutorial that "explains" how to do things using a GUI interface (phpMyAdmin included) is a crutch. </opinion> As you have seen, it can all be down without phpMyAdmin and possibly in less time or just as much time. My opinion may seem harsh, but trust me after doing this maybe 3 times, it becomes rather pedestrian to move a site to a new host and you won't even think twice about doing it again in the future. 1.) Export the .sql 2.) copy the file.sql to the new host. 3.) create wp db +user +access privileges 4.) Import the file.sql 5.) Edit wp-config.php for db, user and password 6.) edit the siteurl via mysql 7.) Enjoy your migrated site. I have a manual script I use to backup my GoDaddy db and the hardest part was figuring out the "-h<dbhost>" part of it. Once I had that, I can backup the entire site in less than 1 minute. Have a Great Day! Edit: forgot the wp-config edit step. Enjoy the goodness |
Quote:
Quote:
Rgds satimis |
You're welcome.
Glad it worked out. |
Hi Habitual,
I tried cloning piano-03.satimis.com on Godaddy to local server but no tables exported. I tried 3 times. I paid special attention to; Code:
[check] Enclose table and field names with backquotes mysql> show databases; Code:
+--------------------+ 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 Code:
+----------------------------+ Rgds satimis |
That looks like it imported, else the tables would not be there.
Locally, in terminal issue this command: Code:
mysql -p -e "use sat1318107284790; select * from wp_options;" -Ns Also, the db names you create on a new host do NOT have to be named as they are on GoDaddy servers, ie: sat1318107320909 and sat1318107284790... I suggest simpler names on new hosts, such as piano-04 piano-03 so, your "Create database" statement would be something like Code:
CREATE DATABASE piano-0n DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; recommendation. Export from GoDaddy using the settings shown in 1.png attached. Once saved locally, open the file and remove the lines near|on lines 22 and 23 Code:
CREATE DATABASE `sat1318107284790` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; save the file. Note the location of the saved file. create the db locally as root (mysql -p <enter>) Code:
CREATE DATABASE piano-0n DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; exit; Code:
grant all on db_name.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; exit; Now you import it, as root: mysql -p dbname < /path/to/file.sql check the data with Code:
mysql -p -e "use dbname; select * from wp_options;" -Ns |
Hi
Something strange happened here. mysql> SHOW databases; Code:
+--------------------+ $ mysql -p -e "use sat1318107284790; select * from wp_options;" -Ns Enter password: Code:
ERROR 1045 (28000): Access denied for user 'satimis'@'localhost' (using password: YES) I can't resolve WHY? satimis |
Hi Habitual,
Have another round Cloned another VM and performed another test following that article mentioned before. The steps works but missing following steps; 1) on local server $ sudo mv /var/www/wordpress/wp-content /var/www/wordpress/wp-content.OLD 2) start FileZilla on local server copy Live site "wp-content", the complete folder, to local site /var/www/wordpress/ 3) Change the permalinks Now the local site works same as Live site The author suggests running "WordPress Database Backup". But I couldn't make it work. Edit: A further question. Have you tried before copying several Live sites on the same server? It is possible creating several databases on ONE MySQL. What about WordPress? How to create several localhosts on same WordPress instead of installing several copies of WordPress on the same server. Rgds satimis |
Quote:
Over here, you had used sat1318107320909, so now try Code:
$ mysql -uroot -p -e "use sat1318107320909; select * from wp_options;" -Ns Code:
$ mysql -uroot -p -e "use sat1318107284790; select * from wp_options;" -Ns Quote:
Several wp databases in one mysql environment? sure can. Easier-to-remember what is what and where: mkdir /var/www/piano3 mkdir /var/www/piano4 copy your GD Live site files using FileZilla to each of those directories. Export each site into its own pianoN.sql file http://piano-03.satimis.com into piano3.sql http://piano-04.satimis.com into piano4.sql as root: Code:
mysql -uroot -p Now grant the same user/pass but on those 2 dbs in mysql> using "mysql -uroot -p" (DO NOT CHANGE DBs) Code:
grant all on piano3.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; Code:
grant all on piano*.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; exit; Code:
mysql -uroot -p piano3 < /path/to/piano3.sql edit each wp-config.php in each of those directories to point to the "correct" db and using the correct 'wordpress' user and their <password>) http://localhost/piano3 should have a site resembling http://piano-03.satimis.com/ http://localhost/piano4 should have a site resembling http://piano-04.satimis.com/ when checking for success and code output using mysql -p -e "some command" -Ns, use Code:
mysql -uroot -p -e "some command;" -Ns Editorial note: All this work for what appears to be a stock install with no posts at http://piano-04.satimis.com/ ? You could have installed a fresh wp instance and added the theme/plugins and be done with it by now. but then what would you have learned? A note about DBs: The dbs can be named anything you want. Paris, Madrid, SanFrancisco, or Mars, Venus, Earth, etc... Just because GoDaddy exports your data as sat1318107320909 or sat1318107284790 you do NOT have to name your dbs that way when you move it/them. P.S. I'm done helping here. If I have to repeat these same instructions one more time, I'll go mad. |
Quote:
$ mysql -uroot -p -e "use sat1318107284790; select * from wp_options;" -Ns Enter password: Code:
..... $ mysql -uroot -p -e "use sat1318107284790; select * from wp_options;" -Ns Enter password: Code:
ERROR 1049 (42000) at line 1: Unknown database 'sat1318107284790' satimis |
the db sat1318107284790 has your wp data in it.
Good Luck. I'm done. |
Hi Habitual,
Thanks for your detail instruction. Performed following steps; Cloned a new VM, WordPress and LAMP already installed and working. $ sudo mkdir /var/www/piano1 $ sudo mkdir /var/www/piano2 $ su Password: # filezilla Start FileZilla -> connect Godaddy server copied GD Live site files. (remark: I must start FileZilla as root otherwise I can't copy files to /var/www/piano1 and /piano2) Ran GD online phpMyAdmin exporting; sat1317312174333 to /Downloads/piano1.sql sat1318208313544 to /Downloads/piano2.sql # mysql -uroot -p Enter password: mysql> CREATE DATABASE piano1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Code:
Query OK, 1 row affected (0.00 sec) Code:
Query OK, 1 row affected (0.00 sec) Code:
Query OK, 0 rows affected (0.00 sec) Code:
Query OK, 0 rows affected (0.00 sec) Code:
Query OK, 0 rows affected (0.00 sec) Code:
Query OK, 0 rows affected (0.00 sec) # mysql -uroot -p piano1 < Downloads/piano1.sql Enter password: # mysql -uroot -p piano2 < Downloads/piano2.sql Enter password: (remark: no complaint) On browser: http://localhost/piano1 http://localhost/pinao2 Code:
Error establishing a database connection Enter password: Code:
ERROR 1146 (42S02) at line 1: Table 'piano1.wp_options' doesn't exist Enter password: Code:
ERROR 1146 (42S02) at line 1: Table 'piano2.wp_options' doesn't exist mysql> SHOW databases; Code:
+--------------------+ Code:
Database changed Code:
Empty set (0.00 sec) Code:
Reading table information for completion of table and column names Code:
+----------------------------+ Rgds satimis |
Quote:
Quote:
Code:
CREATE DATABASE `dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; They "may" not exist, but look for them anyway. and another step you missed: Quote:
|
Quote:
Quote:
1) define('DB_NAME', 'piano2'); define('DB_USER', 'root'); define('DB_PASSWORD', 'mysql_rootpasswd'); 2) define('DB_NAME', 'piano2'); define('DB_USER', 'GD db_user'); define('DB_PASSWORD', 'GD db_user_passwd'); Rgds satimis |
Don't EVER use root in ANY website config.php file to connect, except on localhost. It's a security risk, except on localhost.
and even that may have issues. (depends if you're behind a router, or firewall) and even then it's a BAD HABIT. What "grant all" statement did you use earlier on piano2? Code:
grep "grant all" /root/.mysql_history Code:
grep "grant all" ~/.mysql_history If it's still not evident, then Code:
mysql -uroot -p -e "use mysql; select User,Host from user;" |
Quote:
Quote:
Code:
mysql> grant all on piano2.* to 'wordpress'@'localhost' identified by 'piano0114'; Quote:
Code:
Enter password: Code:
+------------------+-------------+ satimis |
Great progress, Now let's test from c-line before editing wp-config.php
Code:
mysql -uwordpress -ppiano0114 -e "show databases;" |
Quote:
Code:
+--------------------+ mysql> USE piano1; show tables; Code:
Database changed Code:
Database changed satimis |
re-do these steps...
Quote:
|
Quote:
Password: # ls Downloads/ Code:
piano1.sql piano2.sql Enter password: Code:
Enter password: Code:
ERROR 1007 (HY000) at line 21: Can't create database 'sat1318208313544'; database exists satimis |
Quote:
Code:
CREATE DATABASE `dbname`...<more here possibly>; |
Quote:
Code:
CREATE DATABASE `sat1317312174333` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Code:
CREATE DATABASE `sat1318208313544` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; |
Quote:
|
Quote:
$ cp Downloads/piano2.sql Downloads/piano2.sql.Orig # ls Downloads/ Code:
piano1.sql piano1.sql.Orig piano2.sql piano2.sql.Orig deleted following lines Code:
CREATE DATABASE `sat1317312174333` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; deleted following lines Code:
CREATE DATABASE `sat1318208313544` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; # mysql -uroot -p piano1 < Downloads/piano1.sql Enter password: # mysql -uroot -p piano2 < Downloads/piano2.sql Enter password: (No complaint) # gedit /var/www/piano1/wp-config.php Warning on terminal Code:
.... Code:
define('DB_NAME', 'piano1'); |
don't use gedit?
|
Quote:
made following changes Code:
define('DB_NAME', 'piano2'); Code:
define('WP_HOME','http://localhost/piano2'); http://localhost/piano2 Code:
Error establishing a database connection Edit: Change; Code:
define('DB_HOST', 'sat1318208313544.db.10579588.hostedresource.com'); Code:
define('DB_HOST', 'localhost'); satimis |
Quote:
Quote:
|
Quote:
I mistakenly thought the users are piano1 and piano2. They should be "wordpress", same user. Thanks. After changing the permalinks, the local sites work similar to the Live site. I'll make another round on other Live sites in order to further practise. Lot of thanks for your effort and time in supporting me. Rgds satimis |
Quote:
Glad it worked out. |
All times are GMT -5. The time now is 03:08 PM. |