WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to start MySQL in TCL?  (Read 4149 times)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
How to start MySQL in TCL?
« on: April 04, 2017, 12:21:23 PM »
Hi all,

I've just installed mariadb.tcz & mariadb-client.tcz. However, I'm not sure to start the service on TCL.
Quote
tc@box:~$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
tc@box:~$

According to the info, I should be able to start the service by "sudo /usr/local/mysql/bin/mysqld_safe &"
Quote
tc@box:~$ tce
tce-ab - Tiny Core Extension: Application Browser

S)earch P)rovides K)eywords or Q)uit:
Enter starting chars of desired extension, e.g. abi: maria
Title:          mariadb.tcz
Description:    An enhanced, drop-in replacement for MySQL
Version:        10.0.17
Author:         MariaDB Foundation
Original-site:  https://mariadb.org
Copying-policy: GPL V2, LGPL v2.1
Size:           33.3M
Extension_by:   bmarkus
Tags:           LIBRARY CLI SERVER SQL MYSQL MARIADB
Comments:       Binaries only
                ----
                Start server with command
                'sudo /usr/local/mysql/bin/mysqld_safe &'

                Database is /usr/local/mysql/data
                Backup or use persistent storage
                ----

                Compiled for Core 6.0
Change-log:     2014/11/27 First version, to 10.0.15
Current:        2015/04/06 Updated to 10.0.17

~

tc@box:~$ mysql -V
mysql  Ver 15.1 Distrib 10.0.17-MariaDB, for Linux (i686) using readline 5.1
tc@box:~$

tc@box:~$ df -h | grep -iE 'sql|maria'
/dev/loop9                3.6M      3.6M         0 100% /tmp/tcloop/postgresql-9.5.1
/dev/loop14               1.8M      1.8M         0 100% /tmp/tcloop/mariadb-client
tc@box:~$

However, the command not found and there is no such directory "usr/local/mysql/" in my TCL. Please advise.
Quote
tc@box:~$ sudo /usr/local/mysql/bin/mysqld_safe &
tc@box:~$ sudo: /usr/local/mysql/bin/mysqld_safe: command not found

[1]+  Done(1)                    sudo /usr/local/mysql/bin/mysqld_safe
tc@box:~$ cd /usr/local/
tc@box:/usr/local$ l
total 0
drwxr-xr-x    2 root     root        1.7K Feb 20  2010 bin/
drwxr-xr-x    6 root     root         180 Feb 21  2010 etc/
drwxr-xr-x    6 root     root        1.6K Oct  2  2015 lib/
drwxr-xr-x    2 root     root         100 Apr 10  2016 libexec/
drwxr-xr-x    2 root     root          60 Apr 10  2016 sbin/
drwxr-xr-x   11 root     root         240 Oct  2  2015 share/
drwxrwxr-x    2 root     staff        360 Feb 20  2010 tce.installed/
drwxr-xr-x    3 root     root          60 Apr  4 16:03 var/
tc@box:/usr/local$

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to start MySQL in TCL?
« Reply #1 on: April 04, 2017, 12:46:05 PM »
You forgot to load mariadb.tcz.

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to start MySQL in TCL?
« Reply #2 on: April 04, 2017, 01:02:26 PM »
You forgot to load mariadb.tcz.
Already installed
Quote
tc@box:/mnt/sda1/tce/optional$ ls -lh | grep maria
-rw-rw-r--    1 tc       staff       1.8M Apr  4 16:00 mariadb-client.tcz
-rw-rw-r--    1 tc       staff         34 Apr  4 15:58 mariadb-client.tcz.dep
-rw-rw-r--    1 tc       staff         53 Apr  4 16:00 mariadb-client.tcz.md5.txt
-rw-rw-r--    1 tc       staff       7.7M Apr  4 15:50 mariadb.tcz
-rw-rw-r--    1 tc       staff         49 Apr  4 15:48 mariadb.tcz.dep
-rw-rw-r--    1 tc       staff         46 Apr  4 15:48 mariadb.tcz.md5.txt
tc@box:/mnt/sda1/tce/optional$

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to start MySQL in TCL?
« Reply #3 on: April 04, 2017, 01:09:40 PM »
That just shows you download it.
Run "tce-load -i mariadb".

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: How to start MySQL in TCL?
« Reply #4 on: April 04, 2017, 01:11:04 PM »
Hi Adam
You forgot to load mariadb.tcz.
Already installed
Quote
tc@box:/mnt/sda1/tce/optional$ ls -lh | grep maria
-rw-rw-r--    1 tc       staff       1.8M Apr  4 16:00 mariadb-client.tcz
-rw-rw-r--    1 tc       staff         34 Apr  4 15:58 mariadb-client.tcz.dep
-rw-rw-r--    1 tc       staff         53 Apr  4 16:00 mariadb-client.tcz.md5.txt
-rw-rw-r--    1 tc       staff       7.7M Apr  4 15:50 mariadb.tcz
-rw-rw-r--    1 tc       staff         49 Apr  4 15:48 mariadb.tcz.dep
-rw-rw-r--    1 tc       staff         46 Apr  4 15:48 mariadb.tcz.md5.txt
tc@box:/mnt/sda1/tce/optional$
No, that just means they are on your machine.

You showed this:
Code: [Select]
tc@box:~$ df -h | grep -iE 'sql|maria'
/dev/loop9                3.6M      3.6M         0 100% /tmp/tcloop/postgresql-9.5.1
/dev/loop14               1.8M      1.8M         0 100% /tmp/tcloop/mariadb-client
tc@box:~$
mariadb-client.tcz is loaded, mariadb.tcz is not loaded.

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to start MySQL in TCL?
« Reply #5 on: April 04, 2017, 01:32:37 PM »
Got it. Many thanks Rich & Gerald  :)

Quote
tc@box:~$ df -h | grep -iE 'sql|maria'
/dev/loop9                3.6M      3.6M         0 100% /tmp/tcloop/postgresql-9.5.1
/dev/loop12               1.8M      1.8M         0 100% /tmp/tcloop/mariadb-client
/dev/loop16              32.5M     32.5M         0 100% /tmp/tcloop/mariadb
tc@box:~$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
tc@box:~$
tc@box:~$ sudo /usr/local/mysql/bin/mysqld_safe &
tc@box:~$ 170404 17:27:04 mysqld_safe Logging to '/usr/local/mysql/data/box.err'.
170404 17:27:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

tc@box:~$ ne -anp | g 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1341/mysqld
tc@box:~$
tc@box:~$ mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.0.17-MariaDB Source distribution

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>