Technical FAQ

General | FrontPage | PHP | CGI | E-Mail | Webstats | Miva E-Commerce | MySQL | RealAudio/Video < || > Online Manual

MySQL

- How many databases can I create?
- What are the shell commands to access MySQL?
- How do I create a backup of my MySQL database?
- How do I import a MySQL database?
- How do I connect to MySQL through PHP?
- How do I connect to MySQL using MySQLPerl Module?
- Do you have mysqladmin support?
- How can I administer MySQL over the web?
- Where can I find phpMyAdmin?
- Can I use ODBC with MySQL?
- Can I use JDBC with MySQL?

 


Q: How many databases can I create?

A: We allow 4 individual databases (Premium plan) that you can create using your WebControl System.
Note: It may take several minutes until the database has been created by the system!

Back to top


Q: What are the shell commands to access MySQL?

A: Use the following outline to connect and begin querying the MySQL server from your shell account. Remember that you cannot connect to your databases remotely due to security concerns, you can only connect from localhost.

1. Connect to the MySQL Server
servername:> mysql -u username -p
Enter Password: password

2. Connect to the Database
mysql> use database_name;

3. Receiving Help
mysql> help

Back to top


Q: How do I create a backup of my MySQL database?

A: You will want to run what is called a "mysql dump"

1) ssh into your domain. Navigate to the directory you wish to "dump", or "backup" your database into ... most likely your home directory.

2) then run this command
mysqldump -q database_name > name.sql -pyour_password

3) >>replace "database_name" with the name of your database
>>replace "name.sql" with your database_name.sql
>>after the -p, just continue typing your password
do not put a space after the -p, just type continuously.

Example:
my database name is foon, and my password is 123456
mysqldump -q foon > foon.sql -p123456

4) to see if you have created a successful backup copy, just list the contents of your /home directory ( or whichever directory you dumped the file into )

listing directory by typing dir at the prompt:
machine:/home/userid$ dir

Hit Enter

example output:
-rw-rw-r-- 1 userid userid 1330 Sep 30 1953 foon.sql

>>> If you want to know how to restore this backup read the next QA below.

Back to top


Q: How do I import a MySQL database?

A: You create your database first (will be created within 15 minutes) from your web control panel and then import from your dump file.

Log onto your shell account and enter the following at the command line

mysql -u username -p database_name < /path/to/dumpfile

Example:
You create the database 'foon' and your dump file is /home/userid33/mydata.dump

The command you are typing at the prompt of your shell account would be:
mysql -u userid33 -p foon < /home/userid33/mydata.dump

Hit Enter, you will be prompted for your mysql database password
Enter password: enter_your_mysql_password_here
Hit Enter!

your are done!

Back to top


Q: How do I connect to MySQL through PHP?

A: Use the following outline to connect and begin querying the MySQL server from within your PHP scripts. Remember that you cannot connect to your databases remotely due to security reasons. You can only connect to them from localhost.

1. Connect to the MySQL Server
Use the following statement to connect to the database server. Substitute the username, and password for ones you have created in the WebControl System.

MYSQL_CONNECT('localhost','username','password');

2. Select Your Database
Use the following statement to select the database you wish to connect to. Make sure you substitute the example with your database name.
@mysql_select_db("database_name");

3. Executing A Query
You are now ready to execute your queries. (Most problems that arise with your scripts will be due to incorrect permission settings.)

Back to top


Q: How do I connect to MySQL using MySQLPerl Module?

A: Use the following outline to connect and begin querying the MySQL server from a Perl script. Remember that you cannot connect to your databases remotely due to security concerns. You can only connect from localhost.

1. Declarations
You must require the MySQL package for your script to function properly. Do this by including the following line in your code: use Mysql;

2. Connect to the Database
Somewhere near the beginning of your script, you need to make your initial connection to the database server. Using the following form, substitute your database, username, and password for the examples to connect successfully.
Mysql->connect('localhost','database_name','username','password');

3. Executing a Query
You are now ready to begin querying the database server. [Most problems that you may incur will generally occur due to invalid permission settings for the specified user.]

Back to top


Q: Do you have mysqladmin support?

A: It works on the server, however we do not provide any technical assistance for it.
    It's located at /usr/local/mysql/bin/mysqladmin

Back to top


Q: How can I administer MySQL over the web?

A: You can install phpMyAdmin from your web control panel (yourname.com/cgi-bin/plusmail --> Extras --> MySQL --> phpMyAdmin).
With this excellent script, written in PHP, it's very easy to manage your database(s).
It's free of charge and the best software you can currently get for the MySQL administration.

Back to top


Q: Where can I find phpMyAdmin?

A: We provide a pre-configured version of phpMyAdmin through your web control panel (yourname.com/cgi-bin/plusmail --> Extras --> MySQL --> phpMyAdmin). With the installation simply enter the password for your existing mysql database(s). This password must match your current mysql password or it won't work.
After installation you can find it at yourname.com/pma/
If you need a certain version of phpMyAdmin which we don't provide, you may install your own copy of phpMyAdmin. Download from the official web site.

Back to top


Q: Can I use ODBC with MySQL?

A: At this time we do not support ODBC.

Back to top


Q: Can I use JDBC with MySQL?

A: At this time we do not support JDBC.

Back to top


- Last modified on 5/13/2003 -


Home / Hosting / Domain Lookup / Support / Email Contact

© 1998-2017 Spunkyworld Internet Services - All rights reserved