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 am working with a Raspberry Pi running Debian Linux. I am trying to install MySQL Server and run it and here is what I have done:
# sudo apt-get install mysql-server mysql-client php5-mysql
No errors. Now I rebooted the system, then when starting up I get:
[FAIL] startpar: service(s) returned failure: mysql ... failed!
And I tried
# sudo service mysql start
mysql: unrecognized service
Lastly I tried
# /etc/init.d; mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I find that I have no folder named mysqld in /var/run. But I read that the sock file here shall be created the first time the server is created?
Do you have any suggestions?
Looks like your mysql server is not started. I usually run the stop command and then start it again:
mysqld stop
mysql.server start
Same error, and this works for me.
/etc/init.d; mysql
The usual way to start the mysql server would be
/etc/init.d/mysqld start
The reason it's failing should be written to the logs (usually /var/log/mysqld.log) - what do the logs say?
look into /var/log/mysql/error.log
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I'm starting up with mysql on mac. I have installed Mysql and mysql workbench. My mysql server is running. When I try test connection with mysql workbench I get Can't connect to MySQL server on '127.0.0.1' (49). When I try to connect with terminal it works perfectly. In terminal I use the command mysql -u root -p then enter the password. I can't seem to figure this out, do I need to add something in my.cnf file ? Currently it says
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
I can't find what (49) means in the error too. Thanks in advance. I'm using MacOS Mojave, mysql server version 8.0.17
EDIT : I reinstalled my MacOS, it started working. Guess some issue with some internal file.
Change the Connection Method menu to Local Socket/Pipe.
Leave the "Socket/Pipe Path" field empty to use the default socket. This is equivalent to omitting the -h option when using the mysql command line client.
See the documentation
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 7 years ago.
Improve this question
i am having an issue trying to connect to my mysql after installing it with homebrew...
im unsure what my next steps should be in order to troubleshoot/fix, i am going step by step with an online video tutorial and it doesnt offer me any advice.
the error:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
location of installation:
/usr/local/bin/mysql
version:
mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper
First of all, make sure MySQL is up and running:
mysql.server start &
ps axffu|grep mysql
the above should print out the pid of running mysql process.
If this did not resolve an issue, try to locate the socket:
find /usr/local/mysql -name mysql.sock
find /var/mysql -name mysql.sock
and either update your configuration, or just create a symbolic link to it:
sudo ln -s FOUND_LOCATION /tmp/mysql.sock
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 am trying to import a sql file using command line: mysql -u USERNAME -p DATABASENAME < FILENAME.sql,
but I am not familiar with mysql command line.
I use ssh to connect to server, after connected, it shows: [tamp#need ~]$, i input mysql, it shows: -bash: mysql: command not found,
so what is the problem? what should I do?
It looks like mysql client is not installed on the server (or at least its binary is not in the right PATH); you should ask the system administrator to install it. If you're the administrator, well.. you should install it by your own, depending on which OS is installed on the host, you'd need a different procedure. For example, on debian based system you likely would run:
apt-get install mysql
This indicates that MySQL Client program are not installed in your machine.
You can install MySQL client by:
$ yum install mysql
OR
$ sudo apt-get install mysql-client
In fact, you have 2 options.
Either connect to your distant server using ssh -- then execute remotely mysql CLI on the server. That's what you have tried so far. But as other have already mentioned it, the mysql client doesn't seems to be present there.
The second option is to run mysql CLI on your local machine and connect it to your remote database server.
# Assuming your DB server has the DNS name "my-sql-server.home.local":
local-machine$ mysql -u user -h my-sql-server.home.local -p
# or
# Assuming you access your DB server by its IPv4 address "192.168.0.10"
local-machine$ mysql -u user -h 192.168.0.10 -p
Please note that, depending your mysql-server setup and your security policy the access may or may not be granted.
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 10 years ago.
Improve this question
I installed MySQL using the DMG file (http://dev.mysql.com/downloads/mysql/), and I installed the MySQL_etc.pkg, the MySQLStartUpItem.pkg and the MySQL.prefPane items.
Every time I try to start mysql from the command line I get the message:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
Thanks to various posts on stackoverflow I discovered that this was because MySQL was not running. So I go to the MySQL pane in System Preferences and sure enough "The MySQL Server Instance is stopped". I click "Start MySQL Server" and I get the spinning beach ball for 2 minutes, then nothing happens. The MySQL Server Instance stays stopped.
If I restart my computer then I can go to the MySQL pane and it tells me that "The MySQL Server Instance is running". And sure enough mysql -v at the command line tells me my MySQL connection id, and that I have server version 5.6.10. But then if I leave mysql by typing exit the server instance stops, and I can only restart it by restarting my computer!
Any ideas? I haven't even been able to run MySQL for long enough to set passwords, let along create a database!
After an afternoon of false leads (I don't mean to sound ungrateful, all suggestions were followed up and I'm thankful for all advice), I uninstalled all traces of MySQL and reinstalled an older version, following the advice on this blog: http://soatechlab.blogspot.com/2011/01/completely-remove-mysql-on-mac-os-x.html
It appears to be working now.
Try:
prompt$ sudo mysqld -u root <secure password goes here!>
Note the sudo: MySQL wouldn't let me start up the server without root access to both the computer and MySQL itself. Also note that the program is mysqld, not mysql.
The command varies depending on how you installed MySQL. Try this first:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
If that fails:
cd /usr/local/mysql
sudo ./bin/mysqld_safe
(Enter your password, if necessary)
(Press Control-Z)
bg
I havent' tried this, but check this out if you are working with MAMP and php:-
http://twob.net/journal/fix-for-mamp-mysql/
Maybe even try a re-install and follow these docs:-
http://dev.mysql.com/doc/refman/5.6/en/macosx-installation.html
In addition, plenty of brainstorming on this page:-
https://stackoverflow.com/questions/4788381/getting-cant-connect-through-socket-tmp-mysql-when-installing-mysql-on-m
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 11 years ago.
Improve this question
I just installed mySQL (mysql-5.5.19-osx10.6-x86_64) on my Mac OS X and when I try to run one of the mysql command like mysqld I get the following error:
-bash: mysqld: command not found
Is there something I am missing? I've tried restarting Terminal and I made sure to run the command for the files located in /usr/local/mysql/bin.
Thanks
/usr/local/mysql/bin is most likely not in your system's PATH environment variable. You can add it to your path by adding a line like this to your ~/.bash_profile
export PATH=${PATH}:/usr/local/mysql/bin
(you'll need to restart your shell for the above to take effect.) Another option is to symlink the MySQL binaries to a directory that is already on your path. Something like this:
sudo ln -s /usr/local/mysql/bin/mysqld /usr/bin/mysqld
You'll need to enter the root password in order to add symlinks to /usr/bin. Alternatively, you could make no changes at all and simply use a fully qualified path to execute the command
/usr/local/mysql/bin/mysqld