× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Connecting to mySQL on the Duo?

theindustry
Aspirant

Connecting to mySQL on the Duo?

Hi everyone,

After reading on about how to connect to mySQL on the DUO, I tried the following, which throws the below shown output:
#mysql -u admin -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


So after reading some more, I learned that I had to comment out the
skipnetworking
and change:
bind address = 0.0.0.0
. So I thought that I should be able to restart now, but no.

Any command being run to restart, stop, shutdown or start throws this error with the addition;
Check that mysqld is running and that the socket '/var/run/ysqld/mysqld.sock' exists!


Seriously, this is getting tough now. I have read everything I could find and now I have no idea on what to do to get mySQL working. What can I do?
Message 1 of 10
super_poussin
Virtuoso

Re: Connecting to mySQL on the Duo?

Mysql is installed but not running by default

you can install mysqlon addon 🙂
Message 2 of 10
super_poussin
Virtuoso

Re: Connecting to mySQL on the Duo?

the command to launch mysql is


start-stop-daemon -S -q -b -x /usr/sbin/mysqld -- \
--basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock

Message 3 of 10
Quikdav
Aspirant

Re: Connecting to mySQL on the Duo?

Hi

I tried to launch mysql using the super poussin command line but I can't access the server using the Mysql Workbench

Then I have many daemons as below for mysqld when I display all the process that are running !!! why ?

admin 1306 1 8 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1307 1306 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1308 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1309 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1310 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1311 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1313 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1314 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1315 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock
admin 1316 1307 0 00:20 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock


Thanks for your help

David
Message 4 of 10
WhoCares_
Mentor

Re: Connecting to mySQL on the Duo?

You can't access the server because it is using the localhost ip address 127.0.0.1 only. And you're seeing so many instances because that's the way threads were being displayed by libc6 before ... ummm.... version 2.4 I think. And since the Sparc ReadyNAS line still uses libc6 2.3.7 that's normal and nothing to worry about.

-Stefan
Message 5 of 10
Quikdav
Aspirant

Re: Connecting to mySQL on the Duo?

Hi Stefan,

Sorry but I don't understand what you mean when you tell "it is using the localhost ip address 127.0.0.1 only" !!

I understand the mysql server is running on my DUO but you mean I can't access it from an other computer (with Mysql Workbench) even if specify the IP address (192.168.11.X) of my DUO in the connection string ?

So what I have to configure to connect to MySQL now the server is running ?

Thanks

David
Message 6 of 10
sphardy1
Apprentice

Re: Connecting to mySQL on the Duo?

For security mysql is configured so that it can only be accessed from 127.0.0.1 - ie only applications running on the NAS itself can access mysql.

You can change this behaviour by adding:
--bind-address='0.0.0.0'

to your command line, which will enable mysql to bind to whatever address the Duo has
Message 7 of 10
Quikdav
Aspirant

Re: Connecting to mySQL on the Duo?

Thanks a lot...

David
Message 8 of 10
mfe_
Tutor

Re: Connecting to mySQL on the Duo?

Hi,

yesterday my MySQL worked. I installed the MySQL on Addon. Today I got when logging in:



fes-a120d19nas:~# start-stop-daemon -S -q -b -x /usr/sbin/mysqld -- \
> --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/run/mysqld/mysqld.sock

fes-a120d19nas:~# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

fes-a120d19nas:~# ps -aux | grep mysql
Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 7189 0.0 0.5 4256 1200 pts/0 S+ 17:20 0:00 grep mysql



Also starting the mysql daemon didnt changed my issue.

My my.cnf looks like that:


[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = admin
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
skip-name-resolve

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
#skip-networking

innodb_buffer_pool_size = 6M
key_buffer_size = 16k
myisam_sort_buffer_size = 16k
max_connection = 20
#
# * Fine Tuning
#
key_buffer = 16k
max_allowed_packet = 16M
thread_stack = 128K
#
# * Query Cache Configuration
#
query_cache_limit = 1048576
query_cache_size = 32768
query_cache_type = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.

# Be aware that this log type is a performance killer.
log = /var/log/mysql.log
log = /var/log/mysql/mysql.log
#
# The following can be used as easy to replay backup logs or for replication.
server-id = 2

log-bin = /var/log/mysql/mysql-bin.log
# See /etc/mysql/debian-log-rotate.conf for the number of files kept.
max_binlog_size = 16384

server-id=2

skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!

[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M



Trying to access the log will result in:

fes-a120d19nas:~# tail /var/log/mysql.log
tail: /var/log/mysql.log: No such file or directory
fes-a120d19nas:~#

Has anyone a Idea what is broken?
Message 9 of 10
mfe_
Tutor

Re: Connecting to mySQL on the Duo?

After checking the permissions on the log file and /var/run/mysqld/ i recognized, that i had to "chown admin:admin" on the folder "/var/run/mysqld/".

greetings
Message 10 of 10
Top Contributors
Discussion stats
  • 9 replies
  • 6190 views
  • 1 kudo
  • 6 in conversation
Announcements