Using MySQL

All of our accounts come with access to MySQL.

Using the Control Panel to Create your MySQL Database

1.  While using your Control Panel, click the MySQL link.
2. 
The next screen that displays will have the database connection on it and will be titled "Sql Account Maintenance."
3.  In the "Db" box type the name of your database then click the "Add Db" button.
4.  In the "Username" box add a username that you intend to use for this database.
5.  Also type a password in the "Password" box.
6.  Now click "Add User"
7.  IMPORTANT:  You must add this user to the database.  In the drop down box toward the bottom of the screen, the "User" box should have loginname_username selected and the "Db" box should have loginname_databasename selected then click the "Add User to Db" button.

Now adjust your CGI/PHP software to reflect this information such as...

$dbhost = "localhost";
$dbname = "loginname_databasename";
$dbuser = "loginname_username";
$dbpass = "enter_your_case_sensitive_password";

The above are just examples, your software will probably have different variable names.

The phpMyAdmin software that will allow you to efficiently and easily maintain your online database from your browser.

PASSWORD TIP:  Do NOT user your FTP/MASTER login password as the same password for your mySQL database!  Use a different password from any other password on your account.  Also make it difficult for anyone to guess by using a combination of upper and lower case letters and numbers.

Connecting to the Server

You can also log in to your mySQL database via SSH Telnet.  Once connected via SSH Telnet simply type...

bash-2.04$> mysql -u loginname_databasename

mysql> Type 'help;' or '\h' for help

Connecting to the Database

Now that you have connected to the server, you can easily connect to the database by...

mysql> use 

MySQL commands

Note that all text commands must end with ';'

Text Commands Switch Commands Description / Action
help \h Synonym for `help'.
? \? Display this help.
clear \c Clear command.
connect \r Reconnect to the server. Optional arguments are db and host.
edit \e Edit command with $EDITOR.
ego \G Send command to mysql server, display result vertically.
exit \q Exit mysql. Same as quit.
go \g Send command to mysql server.
nopager \n Disable pager, print to stdout.
print \p Print current command.
quit \q Quit mysql.
rehash \# Rebuild completion hash.
source \. Execute a SQL script file. Takes a file name as an argument.
status \s Get status information from the server.
tee \T Set outfile [to_outfile]. Append everything into given outfile.
use \u Use another database. Takes database name as argument.

For further details regarding MySQL, visit the MySQL Home Page or visit our Web Developer Resources page.

[Manual Index]

 

Copyright © 2000-2006 ActiveWebHost.com. All Rights Reserved. Terms and Conditions of Use and Privacy Policy. ActiveWebHost.com - Your Success Is Our Success