Get Hosted from $7.95!
mysql
Get Hosted for only $7.95 Clients login here... Get hosted NOW! Check out our great reseller program! Click here for support options. Compare our plans Click here to contact us.

MySQL FAQ

1. Add/remove Mysql database(named domain name)

2. Advantages of MySQL and PHP over ASPs

3. Connecting MS Access and MySQL databases

4. Getting started with a MySQL Database

5. MySQL debug command

6. MySQL Manual Location

7. No edit/delete in MySQL Admin

8. Using PHP to Connect to MySQL

9. Write Conflict when updating MySQL table in MS Access



1. Add/remove Mysql database(named domain name)

You can add or remove a mySQL database easily using the Control Panels.

The default name for the database will be the domain name, and the default user name will be the domain's user name. You can set a separate password or use the same one.

Just follow the instructions when you click on the mySQL icon on your control panel.

-------------------------
Example:

domain: foo-bar.com
user: foo
pass: foospass

Resultant database:

db name: foo_bar_com
db user: foo
db pass: foospass
-------------------------

[To add/remove additional databases, or to use another user name, make a request to Tech Support.]

Top


2. Advantages of MySQL and PHP over ASPs

Here are some of the reasons to switch:

1). UNIX is more reliable. Here are some articles backing this up.
UNIX vs. NT 4.0 Service Pack 3 from an experienced user:

http://www.zdnet.com/sr/columns/sjvn/980528.html

UNIX vs. NT 5.0 with detailed comparison:

http://www.zdnet.com/zdnn/content/inwk/0513/305389.html

2). MySQL is a very fast Database System. This page will allow someone to compare MySQL with a bunch of other database systems.

http://www.mysql.com/benchmark.html

3). MySQL is very functional. This page allows comparisons of the
different functions between MySQL and other Database Systems.

http://www.mysql.com/crash-me-choose.html

4). PHP 4.0 is designed to be fast and was written to do database work. PHP 4.0 is a server side HTML embeded scripting language, meaning that PHP is embeded in the HTML files and the server does the work of translating the PHP 4.0. This means that it is totally platform and browser independent. [it is possible to make things platform and browser independent with Microsoft ASP (Active Server Pages) having the server do all the compiling, but PHP 4.0 is backed up with UNIX reliability and Database speed; ASP is not quicker than PHP 4.0]. PHP 4.0 is reliable and fast.

You can look here for further information on PHP 4.0:

http://www.php.net

Top


3. Connecting MS Access and MySQL databases

Connecting MS Access to a MySQL database

-- You will first need to contact support to request that we give you access to MySQL remotely, e.g., ODBC.

ON LOCAL PC:
1) Download and Install MyODBC 2.50.19 (or most current version) on local Win95/98/ME/2000 machine with MS Access installed download it at:

http://www.mysql.com/download.html

2) Fill in the following settings:

Windows DNS Name: You can choose the names, must be unique
Server: This is your domain name or IP address
MySQL Database Name: The name of your MySQL database
User: Your MySQL username
Password: Your MySQL password
Port: leave blank for default (3306(
Options; Select "Return Matching Rows"


3) To Link a Table

a) File...Get External Data...Link Tables
b) Under 'Files of Type:', select "ODBC Database"
c) Select Machine Data Source Tab, and select the appropriate Data Source
Name
d) Select the tables(s) to link

Let us know if you need anything else.

Top


4. Getting started with a MySQL Database

How do I Get Started?

1. Go to your control panel (www.yourdomain.com/menu) and choose MySQL from the panel and follow the directions.

2.Once it's created, from your ssh prompt you type the following command line to access your database:

/usr/local/mysql/bin/mysql dbname -u username -ppassword
(no space between the -p and the password)

You can also access your MySQL Database from the Web using programming languages such as Perl and PHP.

Top


5. MySQL debug command

printf("MYSQL DEBUG: %s %s: <BR>n", mysql_errno(), mysql_error());

Top


6. MySQL Manual Location

For detailed information regarding MySQL, you can go to the MySQL Online Manual:

http://www.mysql.com/Manual/manual_toc.html

Top


7. No edit/delete in MySQL Admin

This occurs when the table, which you have created, does not contain a unique identifying field. In most cases, this can be avoided by always specifying a primary key for the table that you are creating. Unfortunately, there is no way of adding a new field to an existing table as a primary key. This is because the primary key cannot contain a NULL value, which would be the case for every record in the table. The solution...create another table, but include a field that will be a primary key. (The easiest way of doing this is making it an auto increment number...from the options menu)


Top


8. Using PHP to Connect to MySQL

How do I work with a MySQL database using PHP?

1.To merely display the information in your database without the use of a form to call a php script you simply create your HTML document as you would any other web page but instead of the extension of .htm or .html you need to name the file with the extension .phtml. Then within the document itself the section that you'd like to be the PHP code, you begin it with <? and end it with ?>. For instance:

<P>These are the products I sell:</P>

<TABLE BORDER="1">

<?
mysql_connect("localhost", username, password);
$result = mysql(mydatabase, "select * from products");
$num = mysql_numrows($result);
$i = 0;

while($i < $num) {
echo "<TR>n";
echo "<TD>n";
echo mysql_result($result,$i,"prodid");
echo "</TD>n<TD>";
echo mysql_result($result,$i,"name");
echo "</TD>n<TD>";
echo mysql_result($result,$i,"price");
echo "</TD>n";
echo "</TR>n";
$i++;}
?>
</TABLE>

Thus having the loop in the php program create a table with the products listed. NOTE your username and password for the database are not written in the file when it's displayed on the Internet so users viewing the source of your webpage will not see your password.

2.When using a CGI script to pull information from a form which has been submitted by a browser you must have the first line of the script have this command on it (Much like perl scripts):

#!/usr/local/bin/php

Top


9. Write Conflict when updating MySQL table in MS Access

Question:

When I modify a field in MS Access and try and save the record, it shows a "write conflict" error ("someone else has modified this record since you started editing it..."). I know this is not the case, nobody else is accessing this DB.

Answer:

The reason for this is that Access needs to have a field that is a timestamp in order for it to update fields. You should just create a field in your table that is type TIMESTAMP, and you will then be able to update the table.

Go to http://mysql.com/Manual/manual.html#ODBC for more information.

Top

Contact us. Copyright © 2002 Carova Group, LLC. View our Privacy Policy and Acceptable Use Policy
Site design by Tindell Associates