mySQL commands not recognized in the Unix Shell [closed] - mysql

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

Related

Fix 'this authentication plugin is not supported' when trying to connect with MySQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Getting this error when go application is trying to connect with MySQL 8
This error is coming because MySQL increases its security level in a new version. It has changed its default authentication plugin from mysql_native_password to caching_sha2_password.
The workaround to resolve this issue is
First locate your my.cnf file location using below command.
mysql --help | grep "Default options" -A 1
Then update my.cnf , using below lines
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
**default-authentication-plugin=mysql_native_password** // add this line
cd /usr/local/bin
mysql.server stop
mysql.server start
This will solve your issue :)

how to use mysql command in ssh? [closed]

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.

MySQL Server does not start on Raspberry Pi [closed]

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

Can't access MySQL via command line [closed]

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've installed MySQL on a Mac OSX Snow Leopart but I am unable to launch it through the terminal:
$ mysql
-bash: mysql: command not found
With $ echo $PATH:
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin/usr/local/mysql/bin/mysql
With this:
$ /usr/local/mysql/bin/mysql
It works but I am unable to use it with Ruby on Rails. So I guess there's something that I'm missing. My apologies if it isn't clearly explained.
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin/usr/local/mysql/bin/mysql
should be
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin
Path goes to directories and you need the : between entries.
You can also symlink mysql into something in your path
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

mysql restore database [closed]

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 am try to restore a big database from file using this command
source /path/to/database/file
it is return this error:
Failed to open file '/path/to/database/file', error: 27
the .sql file size 4.1G
If that's a file created by the mysqldump command, you'll probably want to run it using the mysql program. That'll be something like mysql -u <username> -p <databasename>
The mysqlimport command is another command you might wanna look at.