Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' during manual installation of mysql
up vote
1
down vote
favorite
I get the error below when attempting to manually install mysql-5.6.17-linux-glibc2.5-x86_64
Steps I followed:
1. tar -xzvf mysql-standard-5.1.34-linux-i686-glibc23.tar.gz
2. ln -s mysql-standard-5.1.34-linux-i686-glibc23 mysql
a) set basedir= to the full path of your new mysql directory
b) set datadir= to the full path of the /data subdir in your new mysql directory.
3. Set up the default MySQL databases:
a) ./scripts/mysql_install_db --defaults-file=mysql.cnf
b) ./bin/mysqladmin --defaults-file=mysql.cnf -u root password "yourpasswordhere"
4. Create a New Database and User Account
a) Log in to your mysql server as root: ./bin/mysql --defaults-file=mysql.cnf -u root -p
mysql.cnf file looks like:
[client]
socket=/tmp/mysql_2.sock
port=3307
####################################
[mysqld]
#REQUIRED!!
#Change the basedir directory to reflect your mysql home directory
basedir=/mysql
#REQUIRED!!
#Change the data direcory to reflect your mysql data directory
datadir=/mysql/data
port=3307
socket=/tmp/mysql_2.sock
key_buffer_size=64M
#[OPTIMIZATION]
#Set this value to 50% of available RAM if your environment permits.
myisam_sort_buffer_size=1.5G
#[OPTIMIZATION]
#This value should be at least 50% of free hard drive space. Use caution if setting it to 100% of free space however. Your hard disk may fill up!
myisam_max_sort_file_size=100G
#[OPTIMIZATION]
#Our default of 2G is probably fine for this value. Change this value only if you are using a machine with little resources available.
read_buffer_size=1.5G
command:
root@ubuntu:/mysql# ./bin/mysqld_safe --defaults- file=mysql.cnf &
Error:
[1] 2386
root@ubuntu:/mysql# 140415 19:08:12 mysqld_safe Logging to '/mysql/data/ubuntu.err'.
chown: invalid user: `mysql'
140415 19:08:12 mysqld_safe Starting mysqld daemon with databases from /mysql/data
140415 19:08:12 mysqld_safe mysqld from pid file /mysql/data/ubuntu.pid ended
./bin/mysqladmin --defaults-file=mysql.cnf -u
./bin/mysqladmin --defaults-file=mysql.cnf -u root password 12345
./bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!
[1]+ Done ./bin/mysqld_safe --defaults-file=mysql.cnf
I tried to login by command:
./bin/mysql --defaults-file=mysql.cnf -u root -p
Error:
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)
mysql
|
show 6 more comments
up vote
1
down vote
favorite
I get the error below when attempting to manually install mysql-5.6.17-linux-glibc2.5-x86_64
Steps I followed:
1. tar -xzvf mysql-standard-5.1.34-linux-i686-glibc23.tar.gz
2. ln -s mysql-standard-5.1.34-linux-i686-glibc23 mysql
a) set basedir= to the full path of your new mysql directory
b) set datadir= to the full path of the /data subdir in your new mysql directory.
3. Set up the default MySQL databases:
a) ./scripts/mysql_install_db --defaults-file=mysql.cnf
b) ./bin/mysqladmin --defaults-file=mysql.cnf -u root password "yourpasswordhere"
4. Create a New Database and User Account
a) Log in to your mysql server as root: ./bin/mysql --defaults-file=mysql.cnf -u root -p
mysql.cnf file looks like:
[client]
socket=/tmp/mysql_2.sock
port=3307
####################################
[mysqld]
#REQUIRED!!
#Change the basedir directory to reflect your mysql home directory
basedir=/mysql
#REQUIRED!!
#Change the data direcory to reflect your mysql data directory
datadir=/mysql/data
port=3307
socket=/tmp/mysql_2.sock
key_buffer_size=64M
#[OPTIMIZATION]
#Set this value to 50% of available RAM if your environment permits.
myisam_sort_buffer_size=1.5G
#[OPTIMIZATION]
#This value should be at least 50% of free hard drive space. Use caution if setting it to 100% of free space however. Your hard disk may fill up!
myisam_max_sort_file_size=100G
#[OPTIMIZATION]
#Our default of 2G is probably fine for this value. Change this value only if you are using a machine with little resources available.
read_buffer_size=1.5G
command:
root@ubuntu:/mysql# ./bin/mysqld_safe --defaults- file=mysql.cnf &
Error:
[1] 2386
root@ubuntu:/mysql# 140415 19:08:12 mysqld_safe Logging to '/mysql/data/ubuntu.err'.
chown: invalid user: `mysql'
140415 19:08:12 mysqld_safe Starting mysqld daemon with databases from /mysql/data
140415 19:08:12 mysqld_safe mysqld from pid file /mysql/data/ubuntu.pid ended
./bin/mysqladmin --defaults-file=mysql.cnf -u
./bin/mysqladmin --defaults-file=mysql.cnf -u root password 12345
./bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!
[1]+ Done ./bin/mysqld_safe --defaults-file=mysql.cnf
I tried to login by command:
./bin/mysql --defaults-file=mysql.cnf -u root -p
Error:
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)
mysql
"Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!"
– Rinzwind
Apr 15 '14 at 14:29
You need to tell us what you've done to install it. For example, you seem not to have created themysql
user who is apparently needed:chown: invalid user:
mysql'`
– terdon♦
Apr 15 '14 at 14:31
@Rinzwind '/tmp/mysql_2.sock' does not exist. How to check is mysqld working?
– BioDeveloper
Apr 15 '14 at 14:31
@terdon I am trying to create a New Database and User Account. login to it and create a new schema.
– BioDeveloper
Apr 15 '14 at 14:35
@nari2 that should be a question you should not need to ask.ps -ef | grep mysql
would be my choice. By the way: if the socket is not created you probably have permissions problems.
– Rinzwind
Apr 15 '14 at 14:41
|
show 6 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I get the error below when attempting to manually install mysql-5.6.17-linux-glibc2.5-x86_64
Steps I followed:
1. tar -xzvf mysql-standard-5.1.34-linux-i686-glibc23.tar.gz
2. ln -s mysql-standard-5.1.34-linux-i686-glibc23 mysql
a) set basedir= to the full path of your new mysql directory
b) set datadir= to the full path of the /data subdir in your new mysql directory.
3. Set up the default MySQL databases:
a) ./scripts/mysql_install_db --defaults-file=mysql.cnf
b) ./bin/mysqladmin --defaults-file=mysql.cnf -u root password "yourpasswordhere"
4. Create a New Database and User Account
a) Log in to your mysql server as root: ./bin/mysql --defaults-file=mysql.cnf -u root -p
mysql.cnf file looks like:
[client]
socket=/tmp/mysql_2.sock
port=3307
####################################
[mysqld]
#REQUIRED!!
#Change the basedir directory to reflect your mysql home directory
basedir=/mysql
#REQUIRED!!
#Change the data direcory to reflect your mysql data directory
datadir=/mysql/data
port=3307
socket=/tmp/mysql_2.sock
key_buffer_size=64M
#[OPTIMIZATION]
#Set this value to 50% of available RAM if your environment permits.
myisam_sort_buffer_size=1.5G
#[OPTIMIZATION]
#This value should be at least 50% of free hard drive space. Use caution if setting it to 100% of free space however. Your hard disk may fill up!
myisam_max_sort_file_size=100G
#[OPTIMIZATION]
#Our default of 2G is probably fine for this value. Change this value only if you are using a machine with little resources available.
read_buffer_size=1.5G
command:
root@ubuntu:/mysql# ./bin/mysqld_safe --defaults- file=mysql.cnf &
Error:
[1] 2386
root@ubuntu:/mysql# 140415 19:08:12 mysqld_safe Logging to '/mysql/data/ubuntu.err'.
chown: invalid user: `mysql'
140415 19:08:12 mysqld_safe Starting mysqld daemon with databases from /mysql/data
140415 19:08:12 mysqld_safe mysqld from pid file /mysql/data/ubuntu.pid ended
./bin/mysqladmin --defaults-file=mysql.cnf -u
./bin/mysqladmin --defaults-file=mysql.cnf -u root password 12345
./bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!
[1]+ Done ./bin/mysqld_safe --defaults-file=mysql.cnf
I tried to login by command:
./bin/mysql --defaults-file=mysql.cnf -u root -p
Error:
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)
mysql
I get the error below when attempting to manually install mysql-5.6.17-linux-glibc2.5-x86_64
Steps I followed:
1. tar -xzvf mysql-standard-5.1.34-linux-i686-glibc23.tar.gz
2. ln -s mysql-standard-5.1.34-linux-i686-glibc23 mysql
a) set basedir= to the full path of your new mysql directory
b) set datadir= to the full path of the /data subdir in your new mysql directory.
3. Set up the default MySQL databases:
a) ./scripts/mysql_install_db --defaults-file=mysql.cnf
b) ./bin/mysqladmin --defaults-file=mysql.cnf -u root password "yourpasswordhere"
4. Create a New Database and User Account
a) Log in to your mysql server as root: ./bin/mysql --defaults-file=mysql.cnf -u root -p
mysql.cnf file looks like:
[client]
socket=/tmp/mysql_2.sock
port=3307
####################################
[mysqld]
#REQUIRED!!
#Change the basedir directory to reflect your mysql home directory
basedir=/mysql
#REQUIRED!!
#Change the data direcory to reflect your mysql data directory
datadir=/mysql/data
port=3307
socket=/tmp/mysql_2.sock
key_buffer_size=64M
#[OPTIMIZATION]
#Set this value to 50% of available RAM if your environment permits.
myisam_sort_buffer_size=1.5G
#[OPTIMIZATION]
#This value should be at least 50% of free hard drive space. Use caution if setting it to 100% of free space however. Your hard disk may fill up!
myisam_max_sort_file_size=100G
#[OPTIMIZATION]
#Our default of 2G is probably fine for this value. Change this value only if you are using a machine with little resources available.
read_buffer_size=1.5G
command:
root@ubuntu:/mysql# ./bin/mysqld_safe --defaults- file=mysql.cnf &
Error:
[1] 2386
root@ubuntu:/mysql# 140415 19:08:12 mysqld_safe Logging to '/mysql/data/ubuntu.err'.
chown: invalid user: `mysql'
140415 19:08:12 mysqld_safe Starting mysqld daemon with databases from /mysql/data
140415 19:08:12 mysqld_safe mysqld from pid file /mysql/data/ubuntu.pid ended
./bin/mysqladmin --defaults-file=mysql.cnf -u
./bin/mysqladmin --defaults-file=mysql.cnf -u root password 12345
./bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!
[1]+ Done ./bin/mysqld_safe --defaults-file=mysql.cnf
I tried to login by command:
./bin/mysql --defaults-file=mysql.cnf -u root -p
Error:
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql_2.sock' (2)
mysql
mysql
edited Apr 16 '14 at 5:48
asked Apr 15 '14 at 14:04
BioDeveloper
11817
11817
"Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!"
– Rinzwind
Apr 15 '14 at 14:29
You need to tell us what you've done to install it. For example, you seem not to have created themysql
user who is apparently needed:chown: invalid user:
mysql'`
– terdon♦
Apr 15 '14 at 14:31
@Rinzwind '/tmp/mysql_2.sock' does not exist. How to check is mysqld working?
– BioDeveloper
Apr 15 '14 at 14:31
@terdon I am trying to create a New Database and User Account. login to it and create a new schema.
– BioDeveloper
Apr 15 '14 at 14:35
@nari2 that should be a question you should not need to ask.ps -ef | grep mysql
would be my choice. By the way: if the socket is not created you probably have permissions problems.
– Rinzwind
Apr 15 '14 at 14:41
|
show 6 more comments
"Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!"
– Rinzwind
Apr 15 '14 at 14:29
You need to tell us what you've done to install it. For example, you seem not to have created themysql
user who is apparently needed:chown: invalid user:
mysql'`
– terdon♦
Apr 15 '14 at 14:31
@Rinzwind '/tmp/mysql_2.sock' does not exist. How to check is mysqld working?
– BioDeveloper
Apr 15 '14 at 14:31
@terdon I am trying to create a New Database and User Account. login to it and create a new schema.
– BioDeveloper
Apr 15 '14 at 14:35
@nari2 that should be a question you should not need to ask.ps -ef | grep mysql
would be my choice. By the way: if the socket is not created you probably have permissions problems.
– Rinzwind
Apr 15 '14 at 14:41
"Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!"
– Rinzwind
Apr 15 '14 at 14:29
"Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!"
– Rinzwind
Apr 15 '14 at 14:29
You need to tell us what you've done to install it. For example, you seem not to have created the
mysql
user who is apparently needed: chown: invalid user:
mysql'`– terdon♦
Apr 15 '14 at 14:31
You need to tell us what you've done to install it. For example, you seem not to have created the
mysql
user who is apparently needed: chown: invalid user:
mysql'`– terdon♦
Apr 15 '14 at 14:31
@Rinzwind '/tmp/mysql_2.sock' does not exist. How to check is mysqld working?
– BioDeveloper
Apr 15 '14 at 14:31
@Rinzwind '/tmp/mysql_2.sock' does not exist. How to check is mysqld working?
– BioDeveloper
Apr 15 '14 at 14:31
@terdon I am trying to create a New Database and User Account. login to it and create a new schema.
– BioDeveloper
Apr 15 '14 at 14:35
@terdon I am trying to create a New Database and User Account. login to it and create a new schema.
– BioDeveloper
Apr 15 '14 at 14:35
@nari2 that should be a question you should not need to ask.
ps -ef | grep mysql
would be my choice. By the way: if the socket is not created you probably have permissions problems.– Rinzwind
Apr 15 '14 at 14:41
@nari2 that should be a question you should not need to ask.
ps -ef | grep mysql
would be my choice. By the way: if the socket is not created you probably have permissions problems.– Rinzwind
Apr 15 '14 at 14:41
|
show 6 more comments
3 Answers
3
active
oldest
votes
up vote
0
down vote
You should:
- Add a user for your mysql server
useradd -r -s /bin/false -m -d /mysql mysql
- Write an upstart script for your server.
- Check that the
pid
file and socket files can be created by yourmysql
user by executing the properchmod
's.
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
add a comment |
up vote
0
down vote
There are a couple of steps to check when you do it manually that could create the error mentioned above. I will assume you either manually downloaded MySQL from the official site or used a 3rd party PPA to install it:
Check that mysql is not already running:
ps -e|grep -i 'mysqld'
.
If it appears then you need to kill it by doing a
sudo killall -9 mysqld
. In the case it does not die, then grab the PID from theps
you ran andkill -9 PID
Run mysql via
/etc/init.d/mysql start
to see if it creates the same error. If it gives you the exact same error from above then you need to copy themysql.server
file which is found in the support-files folder inside the mysql folder you downloaded or in the/usr/local/mysql
folder and you need to copy it to/etc/init.d/mysql
eg:
cp mysql.server /etc/init.d/mysql
and give it a executable permission chmod +x then try running/etc/init.d/mysql start
again.
If it still gives you a problem then you need to edit the config file in
/etc/my.cnf
and change ALL the/tmp/mysql.socket
lines to/var/run/mysqld/mysqld.sock
or any other socket place you wish to send it. Note that the config file can also be in/etc/mysql/my.cnf
in some cases like mine. The config file has at least 3 lines you need to change.
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
add a comment |
up vote
0
down vote
If your file my.cnf (usually in the /etc/mysql/folder) is correctly configured with
socket=/var/lib/mysql/mysql.sock
you can check if mysql is running with the following command:
mysqladmin -u root -p status
change your permission to mysql folder. If you are working locally, you can do:
sudo chmod -R 755 /var/lib/mysql/
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You should:
- Add a user for your mysql server
useradd -r -s /bin/false -m -d /mysql mysql
- Write an upstart script for your server.
- Check that the
pid
file and socket files can be created by yourmysql
user by executing the properchmod
's.
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
add a comment |
up vote
0
down vote
You should:
- Add a user for your mysql server
useradd -r -s /bin/false -m -d /mysql mysql
- Write an upstart script for your server.
- Check that the
pid
file and socket files can be created by yourmysql
user by executing the properchmod
's.
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
add a comment |
up vote
0
down vote
up vote
0
down vote
You should:
- Add a user for your mysql server
useradd -r -s /bin/false -m -d /mysql mysql
- Write an upstart script for your server.
- Check that the
pid
file and socket files can be created by yourmysql
user by executing the properchmod
's.
You should:
- Add a user for your mysql server
useradd -r -s /bin/false -m -d /mysql mysql
- Write an upstart script for your server.
- Check that the
pid
file and socket files can be created by yourmysql
user by executing the properchmod
's.
answered Apr 15 '14 at 15:01
yorodm
27612
27612
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
add a comment |
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
useradd: user 'mysql' already exists.
– BioDeveloper
Apr 16 '14 at 6:08
add a comment |
up vote
0
down vote
There are a couple of steps to check when you do it manually that could create the error mentioned above. I will assume you either manually downloaded MySQL from the official site or used a 3rd party PPA to install it:
Check that mysql is not already running:
ps -e|grep -i 'mysqld'
.
If it appears then you need to kill it by doing a
sudo killall -9 mysqld
. In the case it does not die, then grab the PID from theps
you ran andkill -9 PID
Run mysql via
/etc/init.d/mysql start
to see if it creates the same error. If it gives you the exact same error from above then you need to copy themysql.server
file which is found in the support-files folder inside the mysql folder you downloaded or in the/usr/local/mysql
folder and you need to copy it to/etc/init.d/mysql
eg:
cp mysql.server /etc/init.d/mysql
and give it a executable permission chmod +x then try running/etc/init.d/mysql start
again.
If it still gives you a problem then you need to edit the config file in
/etc/my.cnf
and change ALL the/tmp/mysql.socket
lines to/var/run/mysqld/mysqld.sock
or any other socket place you wish to send it. Note that the config file can also be in/etc/mysql/my.cnf
in some cases like mine. The config file has at least 3 lines you need to change.
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
add a comment |
up vote
0
down vote
There are a couple of steps to check when you do it manually that could create the error mentioned above. I will assume you either manually downloaded MySQL from the official site or used a 3rd party PPA to install it:
Check that mysql is not already running:
ps -e|grep -i 'mysqld'
.
If it appears then you need to kill it by doing a
sudo killall -9 mysqld
. In the case it does not die, then grab the PID from theps
you ran andkill -9 PID
Run mysql via
/etc/init.d/mysql start
to see if it creates the same error. If it gives you the exact same error from above then you need to copy themysql.server
file which is found in the support-files folder inside the mysql folder you downloaded or in the/usr/local/mysql
folder and you need to copy it to/etc/init.d/mysql
eg:
cp mysql.server /etc/init.d/mysql
and give it a executable permission chmod +x then try running/etc/init.d/mysql start
again.
If it still gives you a problem then you need to edit the config file in
/etc/my.cnf
and change ALL the/tmp/mysql.socket
lines to/var/run/mysqld/mysqld.sock
or any other socket place you wish to send it. Note that the config file can also be in/etc/mysql/my.cnf
in some cases like mine. The config file has at least 3 lines you need to change.
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
add a comment |
up vote
0
down vote
up vote
0
down vote
There are a couple of steps to check when you do it manually that could create the error mentioned above. I will assume you either manually downloaded MySQL from the official site or used a 3rd party PPA to install it:
Check that mysql is not already running:
ps -e|grep -i 'mysqld'
.
If it appears then you need to kill it by doing a
sudo killall -9 mysqld
. In the case it does not die, then grab the PID from theps
you ran andkill -9 PID
Run mysql via
/etc/init.d/mysql start
to see if it creates the same error. If it gives you the exact same error from above then you need to copy themysql.server
file which is found in the support-files folder inside the mysql folder you downloaded or in the/usr/local/mysql
folder and you need to copy it to/etc/init.d/mysql
eg:
cp mysql.server /etc/init.d/mysql
and give it a executable permission chmod +x then try running/etc/init.d/mysql start
again.
If it still gives you a problem then you need to edit the config file in
/etc/my.cnf
and change ALL the/tmp/mysql.socket
lines to/var/run/mysqld/mysqld.sock
or any other socket place you wish to send it. Note that the config file can also be in/etc/mysql/my.cnf
in some cases like mine. The config file has at least 3 lines you need to change.
There are a couple of steps to check when you do it manually that could create the error mentioned above. I will assume you either manually downloaded MySQL from the official site or used a 3rd party PPA to install it:
Check that mysql is not already running:
ps -e|grep -i 'mysqld'
.
If it appears then you need to kill it by doing a
sudo killall -9 mysqld
. In the case it does not die, then grab the PID from theps
you ran andkill -9 PID
Run mysql via
/etc/init.d/mysql start
to see if it creates the same error. If it gives you the exact same error from above then you need to copy themysql.server
file which is found in the support-files folder inside the mysql folder you downloaded or in the/usr/local/mysql
folder and you need to copy it to/etc/init.d/mysql
eg:
cp mysql.server /etc/init.d/mysql
and give it a executable permission chmod +x then try running/etc/init.d/mysql start
again.
If it still gives you a problem then you need to edit the config file in
/etc/my.cnf
and change ALL the/tmp/mysql.socket
lines to/var/run/mysqld/mysqld.sock
or any other socket place you wish to send it. Note that the config file can also be in/etc/mysql/my.cnf
in some cases like mine. The config file has at least 3 lines you need to change.
answered Apr 15 '14 at 15:24
Luis Alvarado♦
143k135483649
143k135483649
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
add a comment |
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
mysqld not running. /etc/init.d does not contain mysql file or folder.
– BioDeveloper
Apr 16 '14 at 5:50
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
There you go. Now copy the mysql server script found on the downloaded tar to the init folder and give it executable permissions. Then run it.
– Luis Alvarado♦
Apr 16 '14 at 14:17
add a comment |
up vote
0
down vote
If your file my.cnf (usually in the /etc/mysql/folder) is correctly configured with
socket=/var/lib/mysql/mysql.sock
you can check if mysql is running with the following command:
mysqladmin -u root -p status
change your permission to mysql folder. If you are working locally, you can do:
sudo chmod -R 755 /var/lib/mysql/
add a comment |
up vote
0
down vote
If your file my.cnf (usually in the /etc/mysql/folder) is correctly configured with
socket=/var/lib/mysql/mysql.sock
you can check if mysql is running with the following command:
mysqladmin -u root -p status
change your permission to mysql folder. If you are working locally, you can do:
sudo chmod -R 755 /var/lib/mysql/
add a comment |
up vote
0
down vote
up vote
0
down vote
If your file my.cnf (usually in the /etc/mysql/folder) is correctly configured with
socket=/var/lib/mysql/mysql.sock
you can check if mysql is running with the following command:
mysqladmin -u root -p status
change your permission to mysql folder. If you are working locally, you can do:
sudo chmod -R 755 /var/lib/mysql/
If your file my.cnf (usually in the /etc/mysql/folder) is correctly configured with
socket=/var/lib/mysql/mysql.sock
you can check if mysql is running with the following command:
mysqladmin -u root -p status
change your permission to mysql folder. If you are working locally, you can do:
sudo chmod -R 755 /var/lib/mysql/
answered Sep 24 '16 at 4:37
minigeek
845412
845412
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f448094%2fcant-connect-to-local-mysql-server-through-socket-tmp-mysql-2-sock-during-ma%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
"Check that mysqld is running and that the socket: '/tmp/mysql_2.sock' exists!"
– Rinzwind
Apr 15 '14 at 14:29
You need to tell us what you've done to install it. For example, you seem not to have created the
mysql
user who is apparently needed:chown: invalid user:
mysql'`– terdon♦
Apr 15 '14 at 14:31
@Rinzwind '/tmp/mysql_2.sock' does not exist. How to check is mysqld working?
– BioDeveloper
Apr 15 '14 at 14:31
@terdon I am trying to create a New Database and User Account. login to it and create a new schema.
– BioDeveloper
Apr 15 '14 at 14:35
@nari2 that should be a question you should not need to ask.
ps -ef | grep mysql
would be my choice. By the way: if the socket is not created you probably have permissions problems.– Rinzwind
Apr 15 '14 at 14:41