Connection to MYSQL inside LAN

Support section for FREESCO v0.3.x 3rd Party Packages

Connection to MYSQL inside LAN

Postby ly9cs » Sun Dec 04, 2011 11:02 pm

Hello
I am running FREESCO 0.3.4
This is my system reporthttp://www.schultze.nu/report.txt

On my inside LAN I have a MYSQL 5.5 running and this I would like to access from my Apache in FREESCO.
I would be happy if I could send some PHP to MYSQL to access the DB:s running there but I have not figured how to jet?

I have changed the php.ini and added the MYSQL server.
Then tried to do a php-script to see if there is any connection
I found this script
Code: Select all
<?php
// we connect to example.com and port 3307
$link = mysql_connect('mysql.inet:3306', 'root', 'MySecretPassWORD!!');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);

// we connect to localhost at port 3307
$link = mysql_connect('127.0.0.1:3307', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>


The return form my FREESCO is
Could not connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Can some one perhatps tell me what I am doing wrong?
Is this possibel?
What do I need to change?
Do I need change the port on my FREESCO to admit the 3306 to MYSQL?


I have added this also
http://www.schultze.nu/php/phpinfo.php
User avatar
ly9cs
Junior Member
 
Posts: 34
Joined: Sun Jun 29, 2003 11:52 pm
Location: Sweden Djungelby

Re: Connection to MYSQL inside LAN

Postby Lightning » Mon Dec 05, 2011 7:56 pm

For mysql you should not use the root account for any access other than direct mysql commands. You need to create a new user with privileges.Something like this from a mysql command prompt logging is as root.
Code: Select all
mysql; GRANT ALL PRIVILEGES ON *.* TO New-User_Name@"%" IDENTIFIED BY 'passwordyouchoose' WITH GRANT OPTION;

Also if you have not set the root password you should using this command
Code: Select all
mysql: SET PASSWORD FOR root=PASSWORD('newpassword');
Make certain that every character is typed in.

After you have created the new-User_Name you can use that user name to login remotely. The root user can only be used directly from the mysql command prompt.

Also it would be helpful to let us know exactly what you are trying to accomplish and why?
A lot of the time there is easier or better ways of doing things.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 3052
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Connection to MYSQL inside LAN

Postby dingetje » Tue Dec 06, 2011 8:00 am

The mysql client library in the FREESCO Apache package is for MySQL 3.x and authentication may not be compatible with a MySQL 5.x database.
http://dev.mysql.com/doc/refman/4.1/en/old-client.html explains what can be done.

Code: Select all
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
    -> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;


replace 'some_host', 'some_user' and 'newpwd' with the required values for your situation. Also make sure you've granted privileges to this user as described in the reply from Lightning.
GreetZ
http://dingetje.homeip.net

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1004
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands


Return to 3rd Party Package Support for FREESCO v0.3.x

Who is online

Users browsing this forum: No registered users and 1 guest