remote creation of MySQL db

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to establish a database on a MySQL database, wherere the MySQL
version is 5.x. Therefore, MySQL uses the new hashing algorithm with regards
to it's passwords.

The database is behind a firewall where I am given a hole through port 3306
to the IP where I am running php.

However, because of the password hashing algorithm in MySQL 5.x and the
incompatibility with the 4.x version of php I must run, I cannot
mysql_connect() -- I need to have the MySQL password altered by:

mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

My question is, is there some way I can perform this MySQL command,
remotely, via say php, given how stuck I am per the above! -Ike

Re: remote creation of MySQL db

Ike, I'm not sure if this helps but you can use mysqladmin to reset
your root password (or someone elses password, for that matter).

More info here (search for mysqladmin on this page):

Re: remote creation of MySQL db

Adam Plocher wrote:

Quoted text here. Click to load it

....or you can use the mysql client (where you type SQL DDL/DML comamnds at
a command prompt.

Both of these require shell access to a machine with the programs available
and which in turn has access to the mysql port on the DBMS so you might...

some_user@home:~ $ ssh  
Last login: Fri Jan 20 20:58:42 2006 from console
webdev@phpbox:~ $ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: x.y.z

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET PASSWORD FOR 'webdev'@'phpbox'  
    -> = OLD_PASSWORD('newpwd');

(if your starting from a MS Windows box get a copy of PuTTy)



Site Timeline