Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

704
Visualizações
Codeigniter Remote Database Connection Issue

A Codeigniter project(in windows) is required to connect with a Remote Mysql Database(in linux server). 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 it 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 via Phpmyadmin and Heidisql using the same username and password. (all privilages granted)

Here is 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

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I faced the same issue before a couple of months ago when connecting to the remote mysql server in linux.

I tried this in mysql via PHPMYADMIN

SHOW VARIABLES LIKE 'old_passwords' and it says me ON

it means that old_passwords=1 in my.cnf file in the server mysql configuration.

Solution for this problem is by updating the password for the corresponding user

Reference : Error: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

over 4 years ago · Santiago Trujillo Relatório

0

Not sure if this would help, but I did encounter similar issue before.

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

instead of

$db['default']['dbdriver'] = 'mysql';
over 4 years ago · Santiago Trujillo Relatório

0

See if this works

Create a user with all privilages, Remember to set host to %

Edit mysqld.cnf and set "bind-address = 0.0.0.0" (may be /etc/mysql/mysql.conf.d/mysqld.cnf)

Restart mysql

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda