Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Error message: sudo: mysql_secure_installation: command not found

Writer Olivia Zamora

I'm trying to learn PHP and I'm just in the process of installing apache,msql and PHP.

I'm on a mac osx 10.7.2

I downloaded: mysql-5.5.18-osx10.6-x86_64.dmg

I'm now at the point of setting the root password and when I type in: sudo: mysql_secure_installation it asks me to enter my password, then it says:

sudo: mysql_secure_installation: command not found

Any help would be appreciated.

3

4 Answers

If you install mariadb over a package manager you will end up with the same error nowadays which can be solved by using this which is the new mariadb name alternative:

mariadb-secure-installation
1

Your PATH is probably not updated since you used the DMG. As such you will need to run this with the full path or modify your PATH to include.

Probably something like:

/usr/local/mysql/bin/mysql_secure_installation

I assume you've followed the Reference Manual

4

This should work:

cd /usr/local/mysql
sudo bin/mysql_secure_installation

As the error message Can't find a 'mysql' client in PATH or ./bin says, mysql_secure_installation is looking for a mysql client in your PATH or ./bin directory - so if you want it to find /usr/local/mysql/bin/mysql, it should be started from /usr/local/mysql.

In my case:

ls -ld /usr/local/mysql*
lrwxr-xr-x 1 root wheel 27 Apr 10 16:43 /usr/local/mysql -> mysql-5.6.24-osx10.8-x86_64
drwxr-xr-x 17 root wheel 578 Apr 10 16:43 /usr/local/mysql-5.6.24-osx10.8-x86_64

So I set the new path into my PATH environment:

cd $HOME
cat .bashrc
export PATH="$PATH:/usr/local/mysql/bin/"
source .bashrc
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):

Cheers

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy