Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have the problem of connecting with mysql on my debian server. I run mysql -u root and get the error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
So I did and I ran the command sudo find / -type s and got
/run/proftpd.sock
/run/mysqld/mysqld.sock
Not /var/run/mysqld/mysqld.sock!
Im simply trying to set up a database server to test it. What should I do?
This question would be better asked on serverfault.com. However, the easiest way to do this (without confusing other Debian apps) would be to create (as root) a symbolic link to the sock file:
# ln -s /run/mysqld/mysqld.sock /var/run/mysqld/mysqld.sock
Connect with mysql -u root -S /run/mysqld/mysqld.sock, this should work.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am using MySQL image with docker, so when I want to get inside the MySQL by this command
docker exec -it mysql_1 MySQL -u root -p"
I have got an error below
"ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
and it seems to me that I have forgotten the password
Any suggestion would be appreciated.
First access your mysql container with this command
docker exec -it mysql_1 bash
or
docker exec -it mysql bash
then follow those steps to reset your root password for your mysql
https://linuxconfig.org/how-to-reset-mysql-root-password-on-your-linux-server
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
When I try to start my docker which has a mysql image, it says the port 3306 is already in use. However, mysql is not even running...
Screenshot of what I've tried : https://i.imgur.com/t7UW1q5.png
My ubuntu server is simply installed from the windows store, pc was restarted, wsl too (I'm running wsl 2). I tried killing the pid 0, but that simply stopped my fluent terminal. I'm not sure what to do anymore since mysql is not running, mysqld neither, no containers are running, nothing...
If anyone knows, I'd really appreciate it.
Thank you very much for the help!
Try this command which should tell you what's reserving the port:
sudo lsof -i -P -n | grep LISTEN
You don't actually have to use 3306 for Mysql, you can modify it with the ports command, for example:
-p 4000:3306
will divert any traffic that is sent to port 4000 to port 3306.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have tried pretty much everything I could read on SO. I cannot connect remotely to my sql server. I can't even telnet to the correct port (3306). The connection just hangs. Here is a list of what I've checked/tried:
1) Privileges in mysql
I've run CREATE USER 'test'#'%' IDENTIFIED BY 'pass'; followed by GRANT ALL PRIVILEGES ON db.* TO 'test'#'%';and I flushed the changes.
2) Editing my.cnf
I edited the line bind-addressto be 0.0.0.0. I have made sure that the port is default (3306) and restarted the mysql service.
3) Checked firewall / that the ports are open
Using netstat -tnlp I checked that mysql is listening to port 3306.
To be sure, I turned off the firewall (i assume...?) using sudo ufw disableĀ“, and ufw status` returns "inactive".
HOWEVER Despite all of the above, I still can't connect to my mysql server remotely. I have tried running mysql -u test -p -h xxx but after entering my password the connection just hangs and I get "unable to connect to remote host, connection timed out".
In addition, as mentioned above, I have attempted telnet xxxxx 3306 from another server (where the x's denote the server IP of course), and the connection also just times out/hangs.
If you have anything else for me to try I'd LOVE to hear it.
Thanks in advance
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a question for you stackers. I'm not so well renowned with server maintenance and admin configuration. My problem is that I wan't to grant read access for a user to my mySQL databases on a remote server that's hosted by a server company.
I'm connecting via ssh to my server and then trying to create a new user for the databases in root -> mysql.
The problem I'm having is that I cannon't seem to connect to the databases from any other ip than as a localhost on the server itself. The bin-adress in my.cnf is pointing to localhost.
Is there another way to do this? Or rather how do you do this?
I really appreciate your answers.
Log in to your remote server via SSH
Open the the my.cnf file in an editor. (On Ubuntu that is located at
/etc/mysql/my.cnf): sudo vi /etc/mysql/my.cnf
Find the bind-address setting under the [mysqld] section and
change it from localhost to your the public IP address of your
server.
Save your edit.
Restart MySQL: sudo service mysql restart
Grant access to the remote user by logging into mysql as root and executing these commands (obviously you'll need to replace the IP address, database name and remote username with the correct values):
mysql -u root -p mysql
mysql> update db set Host='999.999.999.999' where Db='MyDB';
mysql> update user set Host='999.999.999.999' where user='RemoteUsername';
mysql> exit;
More information can be found on this page.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
i am unable to start mysql client in terminal i use the following command to stat mysql client
sudo mysql
and got the following error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
i use this command to start my server
sudo /opt/lampp/lampp start
please tell what i am doing wrong .
Try mysql -u root -h 127.0.0.1.
For some reason mysql from XAMPP doesn't bind socket.