How to: Install and Launch your MySQL Server
Page 1 of 1 • Share •
How to: Install and Launch your MySQL Server
Installation:
Maybe you should see this post: http://slacklinux.darkbb.com/announcements-f1/a-844-mysql-5149-t1177.htm?highlight=mysql
Or still use your Slackware DVD for take the package, you can find it at this path: /slackware/ap/mysql-5.0.84-i486-1.txz
After that, only install it:
I have a little bad habit.. I always, always.. work/use my S.O. like ROOT user. I am the Root, always..
so, in my case I need to set the owner for mysql:
Yes, now.. ME (root) I am owner of mysql files and I can work with these like root user.
When you install MySQL in your system its create an especial user for this sql server, it is named: "mysql"
but, by default this user -mysql- has not assigned some shell. "mysql" user needs a shell for work!
You can see it like this: cat /etc/passwd
Looking the list, we can see the "mysql" user but with a shell false: mysql:x:27:27:MySQL:/var/lib/mysql:/bin/false
Next step, is set the "bash" like shell for the "mysql" user:
Ready, "mysql" user have a shell (bash) for working! Let's go to configure our server!
Here I paste my terminal-text for this HowTo, so you can see the complete process in my system.
Well, when I installed Slackware.. I installed mysql but.. do not add it to boot process.
MySql was not running in the system.
Note: Always, when I use this command: root@tool:~# /etc/rc.d/rc.mysqld start
my terminal seems no responding and I can not see my path (root@tool:~#) again. .
Is all right, I only resize the terminal window, and my path is visible again.. do not worry, everything is ok!
A little bug? I do not know.. . but, the app its runnng so good!
Steps:
1- Permisions (owner and execution)
2- Start the server
3- Log in with "mysql" user in our MySQL Server and Install the Databases
4- Set the password for the root user in MySQL Server
5- Optional: Delete the users with no password
Maybe you should see this post: http://slacklinux.darkbb.com/announcements-f1/a-844-mysql-5149-t1177.htm?highlight=mysql
Or still use your Slackware DVD for take the package, you can find it at this path: /slackware/ap/mysql-5.0.84-i486-1.txz
After that, only install it:
- Code:
#installpkg mysql-5.0.84-i486-1.txz
I have a little bad habit.. I always, always.. work/use my S.O. like ROOT user. I am the Root, always..
so, in my case I need to set the owner for mysql:
- Code:
#root@tool:~# chown -R mysql.mysql /var/lib/mysql
Yes, now.. ME (root) I am owner of mysql files and I can work with these like root user.
When you install MySQL in your system its create an especial user for this sql server, it is named: "mysql"
but, by default this user -mysql- has not assigned some shell. "mysql" user needs a shell for work!
You can see it like this: cat /etc/passwd
- Code:
root@tool:~# cat /etc/passwd
root:x:0:0::/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/false
daemon:x:2:2:daemon:/sbin:/bin/false
adm:x:3:4:adm:/var/log:/bin/false
lp:x:4:7:lp:/var/spool/lpd:/bin/false
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/:/bin/false
news:x:9:13:news:/usr/lib/news:/bin/false
uucp:x:10:14:uucp:/var/spool/uucppublic:/bin/false
operator:x:11:0:operator:/root:/bin/bash
games:x:12:100:games:/usr/games:/bin/false
ftp:x:14:50::/home/ftp:/bin/false
smmsp:x:25:25:smmsp:/var/spool/clientmqueue:/bin/false
mysql:x:27:27:MySQL:/var/lib/mysql:/bin/false
rpc:x:32:32:RPC portmap user:/:/bin/false
sshd:x:33:33:sshd:/:/bin/false
gdm:x:42:42:GDM:/var/state/gdm:/bin/bash
oprofile:x:51:51:oprofile:/:/bin/false
apache:x:80:80:User for Apache:/srv/httpd:/bin/false
messagebus:x:81:81:User for D-BUS:/var/run/dbus:/bin/false
haldaemon:x:82:82:User for HAL:/var/run/hald:/bin/false
pop:x:90:90:POP:/:/bin/false
nobody:x:99:99:nobody:/:/bin/false
worthkunst:x:1000:100:Roberto,,,:/home/worthkunst:/bin/bash
root@tool:~#
Looking the list, we can see the "mysql" user but with a shell false: mysql:x:27:27:MySQL:/var/lib/mysql:/bin/false
Next step, is set the "bash" like shell for the "mysql" user:
- Code:
root@tool:~#usermod -s /bin/bash mysql
Ready, "mysql" user have a shell (bash) for working! Let's go to configure our server!
Here I paste my terminal-text for this HowTo, so you can see the complete process in my system.
Well, when I installed Slackware.. I installed mysql but.. do not add it to boot process.
MySql was not running in the system.
Note: Always, when I use this command: root@tool:~# /etc/rc.d/rc.mysqld start
my terminal seems no responding and I can not see my path (root@tool:~#) again. .
Is all right, I only resize the terminal window, and my path is visible again.. do not worry, everything is ok!
A little bug? I do not know.. . but, the app its runnng so good!
Steps:
1- Permisions (owner and execution)
2- Start the server
3- Log in with "mysql" user in our MySQL Server and Install the Databases
4- Set the password for the root user in MySQL Server
5- Optional: Delete the users with no password
- Code:
root@tool:~# chown -R mysql.mysql /var/lib/mysql
root@tool:~# /etc/rc.d/rc.mysqld start
bash: /etc/rc.d/rc.mysqld: Permission denied
root@tool:~# chmod +x /etc/rc.d/rc.mysqld
root@tool:~# /etc/rc.d/rc.mysqld start
root@tool:~# 100809 03:43:12 mysqld_safe Logging to '/var/lib/mysql/tool.err'.
100809 03:43:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100809 03:43:13 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
root@tool:~# su - mysql
root@tool:~# usermod -s /bin/bash mysql
root@tool:~# su - mysql
It is not necessary to inquire whether a woman would like something for
dessert. The answer is yes, she would like something for dessert, but
she would like you to order it so she can pick at it with your fork. She
does not want you to call attention to this by saying, 'If you wanted a
dessert, why didn't you order one?' You must understand, she has the
dessert she wants. The dessert she wants is contained within yours.
-- Merrill Marcoe, "An Insider's Guide to the American Woman"
mysql@tool:~$ mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h tool password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
mysql@tool:~$ exit
logout
root@tool:~# mysqladmin -u root password 'slackmin'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
root@tool:~# /etc/rc.d/rc.mysqld start
root@tool:~# 100809 03:53:11 mysqld_safe Logging to '/var/lib/mysql/tool.err'.
100809 03:53:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
root@tool:~# clear
root@tool:~# mysqladmin -u root password 'slackmin'
root@tool:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.46 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SELECT host,user,password FROM user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *37458C31C2CB446664E4AE81FAAAE9F9486E50D4 |
| tool | root | |
| 127.0.0.1 | root | |
| localhost | | |
| tool | | |
+-----------+------+-------------------------------------------+
5 rows in set (0.00 sec)
mysql> DELETE FROM user WHERE password='';
Query OK, 4 rows affected (0.00 sec)
mysql> SELECT host,user,password FROM user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *37458C31C2CB446664E4AE81FAAAE9F9486E50D4 |
+-----------+------+-------------------------------------------+
1 row in set (0.00 sec)
mysql> exit
Bye
root@tool:~#
Similar topics» VB.net+mysql connection string
» Install DNW download driver for Win7
» DRHazard Install & and new client patchs
» HOW TO: Install eyes into a dolls head
» [How-to] Root and install Android 2.1 on your T-Mobile G1[Update - Cyanogen 5.0.8]
» Install DNW download driver for Win7
» DRHazard Install & and new client patchs
» HOW TO: Install eyes into a dolls head
» [How-to] Root and install Android 2.1 on your T-Mobile G1[Update - Cyanogen 5.0.8]
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum