[SOLVED] MariaDB for Remote Client Access failed

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] MariaDB for Remote Client Access failed

Postby janpihlgren » Dec 14th, '12, 10:23

I'm trying to access MySQL(MariaDB) from a remote client and that failed.
I have set upp a user (root) at the server (192.168.1.111):
Code: Select all
MariaDB [(none)]> select User, Host, Password from mysql.user where Host <> 'localhost';
+------+-------------+-------------------------------------------+
| User | Host        | Password                                  |
+------+-------------+-------------------------------------------+
| root | zebbie      |                                           |
| root | 127.0.0.1   |                                           |
| root | ::1         |                                           |
|      | zebbie      |                                           |
| jan  | %           | *996972BDAB5ECE98EA52C6FACBA95A15EE7EC1D9 |
| root | 192.168.1.% | *BE9F40FE979EFCA471247658FED5DC495C0E3FCA |
+------+-------------+-------------------------------------------+
6 rows in set (0.01 sec)

MariaDB [(none)]>

Then I tried to connect from 192.168.1.142
Code: Select all
[jan@Humlan etc]$ mysql -h 192.168.1.111 -u root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.111' (110)
[jan@Humlan etc]$

I have edit my.cnf and remarked skip-networking. I can access the database through phpMyAdmin.
Perheps I have missed something ?
Last edited by janpihlgren on Dec 14th, '12, 17:27, edited 1 time in total.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: MariaDB for Remote Client Access failed

Postby viking60 » Dec 14th, '12, 12:54

In addition to commenting out skip networking you need to activate this in my.cnf under the mysqld section
Code: Select all
bind-address=192.168.1.111
Image Flexibility is good and inxi is good... install both!
User avatar
viking60
 
Posts: 255
Joined: Mar 19th, '11, 22:26

Re: MariaDB for Remote Client Access failed

Postby janpihlgren » Dec 14th, '12, 14:00

After changing my.cnf I restarted mysqld. Start of mysqld failed.
I did this:
Code: Select all
[mysqld]
user            = mysql
datadir         = /var/lib/mysql
port            = 3306
socket          = /var/lib/mysql/mysql.sock
pid-file        = /var/run/mysqld/mysqld.pid
skip-external-locking
key_buffer = 16M
max_allowed_packet = 32M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
default-storage-engine = InnoDB
;collation_server = utf8_unicode_ci
;character_set_server = utf8
#bind-address=192.168.1.111

The hash put there to made it possible to start mysqld.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: MariaDB for Remote Client Access failed

Postby tom_ » Dec 14th, '12, 15:36

are you sure your firewalls (on both sides) are allowing that connection?

here the MariaDB guideline

https://kb.askmonty.org/en/configuring-mariadb-for-remote-client-access/
tom_
 
Posts: 423
Joined: Sep 3rd, '11, 12:26
Location: Porto Ercole, Italy

Re: MariaDB for Remote Client Access failed

Postby janpihlgren » Dec 14th, '12, 17:27

:D Thanks! :D
The solution was that I had to open port 3306.
Earlier I don't have to do this (Mandriva). For me this is new. I have to notis this so I remember it in the future.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron