Problem deleting a remote Codeigniter database

To communicate with a remote Mysql database ( on a Linux server ), the Codeigniter project ( on Windows ) is required . here is my database.php configuration.

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'xxx.xxx.x.xxx';
$db['default']['username'] = 'username';
$db['default']['password'] = 'password';
$db['default']['database'] = 'database';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

and he gives an error

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: *:\****\***\htdocs\project\system\database\DB_driver.php

Line Number: 124

but I can access the remote mysql database using Phpmyadmin and Heidisql using the same username and password. (all privileges granted)

Remote database configuration

Server version: 5.0.95
Protocol version: 10
Server: Localhost via UNIX socket
MySQL charset: UTF-8 Unicode (utf8)
MySQL client version: 5.0.95
Used PHP extensions: mysql

Any help would be greatly appreciated.

+4
source share
3 answers

mysql Linux.

mysql PHPMYADMIN

SHOW VARIABLES LIKE 'old_passwords' ON

, old_passwords=1 my.cnf mysql.

password

: : mysqlnd MySQL 4.1+,

+1

, , .

$db['default']['dbdriver'] = 'mysqli';

$db['default']['dbdriver'] = 'mysql';
0

,

Create a user with all privileges , remember to install the% node

Modify mysqld.cnf and set "bind-address = 0.0.0.0" (maybe /etc/mysql/mysql.conf.d/mysqld.cnf)

Restart mysql

0
source

Source: https://habr.com/ru/post/1627447/


All Articles