remote creation of MySQL db

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ike

    remote creation of MySQL db

    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'@'so me_host' = OLD_PASSWORD('n ewpwd');

    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




  • Adam Plocher

    #2
    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):


    Comment

    • Colin McKinnon

      #3
      Re: remote creation of MySQL db

      Adam Plocher wrote:
      [color=blue]
      > 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/...rivileges.html[/color]

      .....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.m ydomain.com
      Password:
      Last login: Fri Jan 20 20:58:42 2006 from console
      webdev@phpbox:~ $ mysql dbadmin@mysqlbo x.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'@'phpbo x'
      -> = OLD_PASSWORD('n ewpwd');

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

      HTH

      C.

      Comment

      Working...