remote creation of MySQL db

remote creation of MySQL db

am 20.01.2006 17:34:27 von Ike

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

am 20.01.2006 17:41:54 von Adam Plocher

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):
http://dev.mysql.com/doc/refman/5.0/en/default-privileges.ht ml

Re: remote creation of MySQL db

am 20.01.2006 22:41:42 von Colin McKinnon

Adam Plocher wrote:

> 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):
> http://dev.mysql.com/doc/refman/5.0/en/default-privileges.ht ml

.....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 webdev@phpbox.mydomain.com
Password:
Last login: Fri Jan 20 20:58:42 2006 from console
webdev@phpbox:~ $ mysql dbadmin@mysqlbox.mydomain.com
Password:
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)

HTH

C.