Archives for the 'MySQL' Category

Copying Table Structures in MySQL

In MySQL it’s possible to create a new table – with the same column names and types of that of an existing table – using the following syntax:
CREATE TABLE <new table> LIKE <existing table>
This is for MySQL 4.1 and above.
MySQL 3.23, 4.0, 4.1 Reference Manual :: 12.1.5 CREATE TABLE Syntax

26 May 2008 | MySQL | 1 Comment

Separate Instances of MySQL 4.0 and MySQL 4.1 on Windows

Assuming you already have MySQL 4.0 running on its default port (3306), install MySQL 4.1 and set its service name to MySQL41 and its port to 3307.
The ASP connection string is as follows:
“driver={MYSQL ODBC 3.51 Driver};” & _
“server=localhost;port=3307;” & _
The PHP connection method is as follows:
$c = mysql_connect(”localhost:3307″, “user1″, “a_password”);
mysql_select_db(”db1″, $c);

28 March 2007 | MySQL, ASP, PHP | 1 Comment