Error establishing a database connection
-
The topic is clear.
This is what I have done so far:
define(‘DB_NAME’, ‘uwedb’); // The name of the database
define(‘DB_USER’, ‘root’); // Your MySQL username
define(‘DB_PASSWORD’, ‘myPass’); // …and passworddoes not connect me.
<html>
<head>
<title>PHP MySQL connection test</title>
<body>
<?php
$connect = mysql_connect(‘localhost’, ‘root’, ‘myPass’);
// if no connect then die
if (!connect) {
die(‘something went wrong’ .mysql_error());
}
echo ‘It is time to enjoy your new OpenBSD Apache PHP MySQL powered web server.’;
// good form to close the connection
mysql_close($connect);
// close the php
?>
</body>
</html>does connect me.
(Yes, I did a non-priviledged account as well, but the behaviour is the same:
mysql -u udippel -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22 to server version: 4.0.23Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
, while the same parameters do not connect me on WordPress.
What would be a reason for this ?
(Of course, mysql shows up on the server as well:
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.0.23
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/local/include/mysql
MYSQL_LIBS -L/usr/local/lib -lmysqlclientDirective Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off)Any input welcome,
Uwe
- The topic ‘Error establishing a database connection’ is closed to new replies.