Go Back   Cloud Computing > Support > MySQL Issues.
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-11, 08:14
BOD Member
 
Join Date: Apr 2011
Posts: 82
Question MySQL FAQs

Hi

How can I access MySQL database through Telnet ?Fire1
Reply With Quote
  #2 (permalink)  
Old 05-16-11, 08:17
BOD Member
 
Join Date: Nov 2010
Posts: 81
Default

Once you sign up a web hosting account, your account database will be initialized by default and ready for use.

According to my knowledge you can access your database via Telnet by using following commands.

Quote:
Type: mysql -p (It will prompt you for the mysql database )
Even you can access it by using following commands lines.
Quote:
mysql -u my_user_name --password=my_password
mysql -u my_user_name -p
Your user name will be the same as your account name.
Reply With Quote
  #3 (permalink)  
Old 05-16-11, 08:26
BOD Member
 
Join Date: Apr 2011
Posts: 82
Default

How can I change MySQL database password via shell prompt?
Reply With Quote
  #4 (permalink)  
Old 05-16-11, 08:27
BOD Member
 
Join Date: Nov 2010
Posts: 81
Default

At first you need to log in to your MySQL database from a shell prompt. Then use the following commands:

Quote:
set password=password('new_password');
where new_password will be the new password that you have selected.

For an example.

Quote:
set password=password('pa$$w0rd');
Reply With Quote
  #5 (permalink)  
Old 05-16-11, 08:34
BOD Member
 
Join Date: Apr 2011
Posts: 82
Default

What is a MySQL default port number?
Reply With Quote
  #6 (permalink)  
Old 05-16-11, 08:35
BOD Member
 
Join Date: Nov 2010
Posts: 81
Default

MySQL port number is the default standard port that is 3306. Most of the leading programs like PHP and Perl DBI will take that default port number if it is not specified.
Reply With Quote
  #7 (permalink)  
Old 05-16-11, 09:11
BOD Member
 
Join Date: Apr 2011
Posts: 82
Default

How can I backup or transfer MySQL database?
Reply With Quote
  #8 (permalink)  
Old 05-16-11, 09:16
BOD Member
 
Join Date: Nov 2010
Posts: 81
Default

While taking backup of MySQL, one thing you need to understand that MySQL database are not backed up like ordinary files and folders. Even if it is possible, it would not be a standard solution, because it can corrupt the database file by doing so.

To back up your mysql database use ssh from your account, then use mysqldump commands :


Quote:
mysqldump -ppassword database name > db1.sql (db1.sql is your backup dump file, you can use any namefor your dump file)
That backs up the entire database in standard sql text format. Both the structure (like CREATE table command) and data (like INSERT command) statements, can be backed up individually, which is useful in many cases.

Quote:
To restore the dump file, just type: mysql -p dbname < db1.sql
Take a note : That the structure of dump file will not work if tables already exist. The backup will not change or replace the structure. For the data dump it will add any new data if it doesn't exist already.

To transfer a mysql database, create the dump file as mentioned above, use FTP to upload it on the another server, and then restore it as above. Mostly people think that database backup can be done via FTP as well. But it is not correct, at first you want to generate mysql dump, and then need to download that dump file.

You can use following mysqldump command lines:

Quote:
mysqldump -ppassword username > db1.sql
Use the next command to view the dump file:
Quote:
view db1.sql
(exit with: q!)
To place the file back: upload the file.


You can edit it with the help of a text editor. Include the following line at the top and use the database name, which is similar to your user name. Next >> save the file and fire the command:

mysql -ppasswd < db1.sql (All the database will be generated, including structure as well)

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 00:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.