Login    Register

Login via SSH to install mySQL

NAS4Free Packages
Forum rules
Set-Up GuideFAQsForum Rules
  • Author
    Message

Login via SSH to install mySQL

Postby marcdd2 » 25 Aug 2012 17:06

I'm trying to install mySQL using this guide, but I don't seem to have the permissions to do anything in putty?

https://sites.google.com/site/aganimkar ... extensions

I've enabled the SSH service, but can't login as admin? I was able to create a user in the admin group with sh shell which allows me to login using putty, but every command I type gives me an error back that I don't have the permissions. Do I login as admin or do I create a user? If I create a user, any idea why my permission wouldn't be right? Thanks.

Dan
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby russian » 25 Aug 2012 17:24

Add "wheel" group to your created user, and after you login to SSH as this user, enter "su" command and then enter root password, so you will be a superuser and could make any commands.
os: FreeBSD 9.1-RELEASE-p4; Nas4Free x64 9.1.0.1.rev804; case: Lian Li PC Q08b; mb: ASUS E35M1-I; cpu: AMD E-350; mem: 4 Gb; hdd: 6xSATA
PowerUser
russian
 
Posts: 71
Joined: 27 Jul 2012 06:11
Location: Russia

Re: Login via SSH to install mySQL

Postby marcdd2 » 26 Aug 2012 05:25

Thanks. It worked great until the end. I'm running Nas4free on a 16GB flash drive and linked /var/db/mysql to a my zfs pool, /mnt/zfspool/data/db/mysql, but I keep getting error messages that say there isn't enough space:

Code: Select all
Welcome to NAS4Free![marcdd2@nas4free /]$ su -
Password:
nas4free:~# mkdir -p /mnt/zfspool/data/db/mysql
nas4free:~# chmod 0777 /mnt/zfspool/data/db
nas4free:~# ln -s /mnt/zfspool/data/db/mysql /var/db/mysql
nas4free:~# setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/pack                                             ages-7-stable/Latest/
nas4free:~# pkg_add -r mysql50-server
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/mysql50-server.tbz...
/var: write failed, filesystem is full
share/mysql/danish/errmsg.sys: Write failed
share/mysql/dutch/errmsg.sys: Write to restore size failed
share/mysql/english/errmsg.sys: Write to restore size failed
share/mysql/errmsg.txt: Write to restore size failed
share/mysql/estonian/errmsg.sys: Write to restore size failed
share/mysql/fill_help_tables.sql: Write to restore size failed
share/mysql/french/errmsg.sys: Write to restore size failed
share/mysql/german/errmsg.sys: Write to restore size failed
share/mysql/greek/errmsg.sys: Write to restore size failed
share/mysql/hungarian/errmsg.sys: Write to restore size failed
share/mysql/italian/errmsg.sys: Write to restore size failed
share/mysql/japanese/errmsg.sys: Write to restore size failed
share/mysql/korean/errmsg.sys: Write to restore size failed
share/mysql/mi_test_all: Write to restore size failed
share/mysql/mi_test_all.res: Write to restore size failed
share/mysql/my-huge.cnf: Write to restore size failed
share/mysql/my-innodb-heavy-4G.cnf: Write to restore size failed
share/mysql/my-large.cnf: Write to restore size failed
share/mysql/my-medium.cnf: Write to restore size failed
share/mysql/my-small.cnf: Write to restore size failed
share/mysql/mysql_system_tables.sql: Write to restore size failed
share/mysql/mysql_system_tables_data.sql: Write to restore size failed
share/mysql/mysql-log-rotate: Write to restore size failed
share/mysql/mysql.server: Write to restore size failed
share/mysql/mysqld_multi.server: Write to restore size failed
share/mysql/ndb-config-2-node.ini: Write to restore size failed
share/mysql/norwegian-ny/errmsg.sys: Write to restore size failed
share/mysql/norwegian/errmsg.sys: Write to restore size failed
share/mysql/polish/errmsg.sys: Write to restore size failed
share/mysql/portuguese/errmsg.sys: Write to restore size failed
share/mysql/romanian/errmsg.sys: Write to restore size failed
share/mysql/russian/errmsg.sys: Write to restore size failed
share/mysql/serbian/errmsg.sys: Write to restore size failed
share/mysql/slovak/errmsg.sys: Write to restore size failed
share/mysql/spanish/errmsg.sys: Write to restore size failed
share/mysql/swedish/errmsg.sys: Write to restore size failed
share/mysql/ukrainian/errmsg.sys: Write to restore size failed
etc/rc.d/mysql-server: Write to restore size failed
info/mysql.info: Write to restore size failed

/var: write failed, filesystem is full
tar: (Empty error message)
tar: Error exit delayed from previous errors.
 Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/All/mysql-client-5.0.95.tbz... Done.

/var: write failed, filesystem is full
mv: /var/db/pkg/mysql-client-5.0.95/+MTREE_DIRS: No space left on device
pkg_add: move_file: could not move './+MTREE_DIRS' to '/var/db/pkg/mysql-client-5.0.95/+MTREE_DIRS'
pkg_add: pkg_add of dependency 'mysql-client-5.0.95' failed!


Any ideas on what the issue is?
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby russian » 26 Aug 2012 06:05

Do u use embedded version? I've tried it for a few times, but then I've came to full install on USB. That is the best way, if you need to install a lot of additional packages. I've tried all this link magic, to move /var to hard drive and so on, but every time it was ended by the problems.

Try full install.
os: FreeBSD 9.1-RELEASE-p4; Nas4Free x64 9.1.0.1.rev804; case: Lian Li PC Q08b; mb: ASUS E35M1-I; cpu: AMD E-350; mem: 4 Gb; hdd: 6xSATA
PowerUser
russian
 
Posts: 71
Joined: 27 Jul 2012 06:11
Location: Russia

Re: Login via SSH to install mySQL

Postby marcdd2 » 30 Aug 2012 04:26

Alright, getting closer. I added another HDD and did the full install. I'm running into an issue here:

nas4free:~# mysqld_safe &
[1] 2355
nas4free:~# ELF interpreter /libexec/ld-elf.so.1 not found
ELF interpreter /libexec/ld-elf.so.1 not found
Starting mysqld daemon with databases from /var/db/mysql
ELF interpreter /libexec/ld-elf.so.1 not found
Abort trap
STOPPING server from pid file /var/db/mysql/nas4free.local.pid
120830 12:23:35 mysqld ended


Any ideas?
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby marcdd2 » 30 Aug 2012 04:34

I checked ls-elf.so.1 and it exists.

nas4free:~# ll /libexec/ld-elf.so.1
-r-xr-xr-x 1 root wheel 105400 Aug 14 04:35 /libexec/ld-elf.so.1
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby alexey123 » 30 Aug 2012 04:40

You mistake in this step
Code: Select all
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/

I wrote manual for Freenas 7.2-xxx install, and not edit it for current. Edited now
When you install any program you need replace packagesite when need.
Delete now mysql from gui and try without this step.
I will wrote script for install mysql.
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1307
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Login via SSH to install mySQL

Postby marcdd2 » 04 Sep 2012 23:01

Almost there. I'm getting an error setting the root password.

Code: Select all
nas4free:~# /usr/local/bin/mysqladmin -u root -h localhost password xxxxxxx
/usr/local/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby alexey123 » 05 Sep 2012 05:59

I need know for help you
1. Yor nas4free version - as 9.0 or 1.0.249 or 250 or 262
2. which version mysql you want install - mysql50, mysql51 or mysql55
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1307
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Login via SSH to install mySQL

Postby marcdd2 » 06 Sep 2012 01:35

Nas4Free 9.1.0.1 - Sandstorm (revision 236)
FreeBSD 9.1-RC1 (reldate 901000)
mysql-server-5.0.95
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby marcdd2 » 06 Sep 2012 01:42

Late last night I was able to do:

Code: Select all
# mysql
mysql> CREATE USER 'xxxxxx' IDENTIFIED BY 'xxxxxxx';
mysql> GRANT ALL ON *.* TO xxxxxx.'%';



I was able to then connect to the db from my clients using the username and password I just added. Am I all set or am I leaving a huge hole in my security with my root not having a password?
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Re: Login via SSH to install mySQL

Postby alexey123 » 06 Sep 2012 07:01

You connect over SSH (with security), you open mysql with root password - I hope this password NOT root of nas4ree :mrgreen:
When you type
Code: Select all
mysql> select User,Host from mysql.user;

Server ask for first time
+------+----------------+
| User | Host |
+------+----------------+
| root | 127.0.0.1 |
|. . . .| localhost |
| root | localhost |
|. . . .| nas4free.local |
| root | nas4free.local |
+------+----------------+
5 rows in set (0.00 sec)


If you not have user root from host all for security, you not have access as root to your building.

For example, I try connect from my PC to created now mysql
Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet> open 10.0.0.50:3306
Connecting To 10.0.0.50:3306...Could not open connection to the host, on port 23
: Connect failed
Microsoft Telnet> open 10.0.0.50 : 3306
Connecting To 10.0.0.50...Could not open connection to the host, on port : 3306:
Connect failed
Microsoft Telnet>



Next step - create users for aplication without GRANT privileges. If users not need access from another host, for example:
1. You have any CMS as Drupal, runing on your nas4free. You not need access as mysql user from local network, all work from localhost.
In this case close over firewall mysql port on nas4free

2. You have any application on another host, uses your nas4free mysql.
In this case create users defined by hostname, where your application running. Also you can close access over firewall to your mysql, exclude host, where your application running

P.S - Thank you for remember, I find bug and need update manual for nas4free full and ebedded instalation. Check pls folder /mnt/<your disk>/mysql/mysql need have permissions 777
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1307
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Login via SSH to install mySQL

Postby marcdd2 » 06 Sep 2012 17:45

Thanks for the help. Everything is looking good.
NewUser
marcdd2
 
Posts: 10
Joined: 25 Aug 2012 16:57

Return to Packages

Who is online

Users browsing this forum: No registered users and 0 guests