MySQL deactivated in Lampp, Xampp on Linux 12.04 - mysql

I have freshly installed xampp-linux-1.8.1 on my Ubuntu 12.04 (Mint 13 maya) Operating system.
When run lampp, I get :
/opt/lampp/lampp start
Starting XAMPP for Linux 1.8.1...
XAMPP: XAMPP-Apache is already running.
XAMPP: Another MySQL daemon is already running.
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.
In the : localhost/xampp/
MySQL DataBase is Deactivated !!!
ps -aux | grep 'mysql'
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html mysql 3159 0.0 0.9 316264 31880 ? Ssl 16:48 0:00 /usr/sbin/mysqld
root 4745 0.0 0.0 4648 840 pts/5 S+ 17:02 0:00 grep --color=auto mysql
When I tried to stop /usr/sbin/mysqld but it can't be stopped with this command !!!
/usr/sbin/mysqld stop
Please I need Help, Thanks.

i've resolved the issue in this way:
sudo chmod -R 777 /opt/lampp
sudo chown -hR nobody /opt/lampp
sudo chmod -R 755 /opt/lampp
then stop other mysqld running with:
sudo service mysql stop

Also had this issue, after troubleshooting for almost 2 hours I found that it was because of other Apache and MySQL packages also running on my system. Removed all Apache and MySQL packages and reinstalled XAMPP again. Success.

Related

How to kill mysql started with "mysql_safe" script?

Short version: I started mysql with mysql_safe and I can't kill it.
Long version: Installing an older version of mysql with macport displayed this suggestion:
$ sudo port install mysql55-server
---> Computing dependencies for mysql55-server
---> Fetching archive for mysql55-server
---> Attempting to fetch mysql55-server-5.5.49_0.darwin_14.noarch.tbz2 from https://packages.macports.org/mysql55-server
---> Attempting to fetch mysql55-server-5.5.49_0.darwin_14.noarch.tbz2.rmd160 from https://packages.macports.org/mysql55-server
---> Installing mysql55-server #5.5.49_0
---> Activating mysql55-server #5.5.49_0
If this is a new install you might want to run:
$ sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
Running that gave these instructions:
$ sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
Installing MySQL system tables...
161102 13:15:44 [Note] /opt/local/lib/mysql55/bin/mysqld (mysqld 5.5.49) starting as process 54176 ...
OK
Filling help tables...
161102 13:15:44 [Note] /opt/local/lib/mysql55/bin/mysqld (mysqld 5.5.49) starting as process 54180 ...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/local/lib/mysql55/bin/mysqladmin -u root password 'new-password'
/opt/local/lib/mysql55/bin/mysqladmin -u root -h myusername password 'new-password'
Alternatively you can run:
/opt/local/lib/mysql55/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /opt/local ; /opt/local/lib/mysql55/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /opt/local/mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
At this point I (unwisely, it seems) ran:
$ cd /opt/local ; /opt/local/lib/mysql55/bin/mysqld_safe &
Now I cannot figure out how to stop the mysql and/or daemondo process(es):
$ ps aux | grep mysql55
myusername 54937 0.1 0.0 2432772 660 s001 R+ 1:39PM 0:00.00 grep mysql55
_mysql 54888 0.0 0.1 2667884 6340 ?? S 1:36PM 0:00.12 /opt/local/lib/mysql55/bin/mysqld --user=_mysql
root 54885 0.0 0.0 2479468 700 ?? Ss 1:36PM 0:00.00 /opt/local/bin/daemondo --label=mysql55-server --start-cmd /opt/local/lib/mysql55/bin/mysqld --user=_mysql ; --pid=exec
I've tried many variations of kill, targeting both mysql (which seems pointless) and daemondo, including (but not limited to) the following:
sudo kill -9 54888 // killing the mysql process results in a new pid
sudo kill 54885 // the doemondo process
sudo kill -SIGHUP 54885
sudo killall mysqld_safe
sudo kill -9 54822 // a reincarnation of the doemondo process
sudo mysqladmin shutdown
For centos or mint
/usr/bin# initctl
for ubuntu
pkill mysqld

MySQL Database stopped in XAMPP-1.8.3.4 in ubuntu 14.04

MySQL already running, but when open http://localhost/phpmyadmin/ I get error like this :
#2002 - Connection refused The server is not responding (or the local server's socket is not correctly configured).
when I try run from command line with sudo /opt/lampp/lampp start, I get the message like this :
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...already running.
I have checked in ps -aux | grep mysqld
I get message like this:
ahmadso+ 7118 0.0 0.0 15948 2220 pts/6 S+ 09:23 0:00 grep --color=auto mysqld
when I try sudo service mysql stop
I get message like this :
stop: Unknown instance:
I use Ubuntu operating system, I have tried to uninstall and reinstall xampp, but does not resolve the issue.
please help me.
Try stopping all XAMPP Services and then start them again:
Stop
sudo service apache2 stop
sudo service mysql stop
Start
sudo service apache2 start
sudo service mysql start

MySql server PID not found

I have CentOS 6.4 with NGINX.
When I try to start/stop/restart mysql server (/etc/init.d/mysqld restart) I get this error:
MySQL server PID file could not be found! [FAILED]
Starting MySQL..The server quit without updating PID file ([FAILED]/mysql/mysqld.pid).
What can I do to solve this problem?
Thanks!
I got the same error on a CentOS 6.3 where I upgraded MySQL to 5.6.14 but I kept the old my.cnf file. After upgrade, MySQL did not start anymore, giving me the same error as you described.
The problem was that I had this setting in my.cnf:
table_cache=2048
According to this link table_cache renamed table_open_cache..
"Seem like in 5.5 the system variable table_cache was renamed
table_open_cache..
In 5.6 mysqld fails if it finds an unknown variable
this means that upgrades from versions earlier than 5.5 can have
problems if table_cache is specified in my.cnf."
After I changed the above line to
table_open_cache=2048
MySQL started perfectly.
So, in the case you have MySQL 5.5+ (and maybe an older my.cnf), I suggest you to do the following:
remove my.cnf from /etc folder and try to start MySQL
if MySQL starts, the the problem is in my.cnf. Comment/uncomment all the settings one by one in order to see which is causing the problem.
Hope this helps.
I upgraded my Mac OS to 10.9.3 and encountered the above problem on mysql.server restart
The following fixed my problem
sudo chmod -R o+rwx /usr/local/var/mysql/
sudo chown -R mysql /usr/local/var/mysql/
sudo mysql.server restart
First of all make sure that which folder/file is not exist in /var/run/mysqld/mysqld.pid
if dir not exists then create it as:
sudo mkdir -p /var/run/mysqld/
if mysqld.pid is not exists then create it as:
sudo touch /var/run/mysqld/mysqld.pid
change ownership as:
sudo chown mysql:mysql -R /var/run/mysqld
chmod 775 -R /var/run/mysqld
restart mysql service
sudo service mysql restart
I find that sometimes MySQL processes are still running. Certainly this was the case on my OS X Yosemite system so use the following command to find any processes that show up with MySQL in the name:
ps aux | grep mysql
Then kill them using the command
sudo kill -9 PID, replacing PID with the offending process ID.
Check if there is a lock.
/etc/init.d/mysql status
If the OS says that there is a lock, something like:
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
remove that lock file and restart.
I found this worked....
# ps aux | grep mysql
root 3668 0.0 0.0 11432 1240 ? S 2014 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/db/data01 --pid-file=/var/lib/mysql/mysql.pid
mysql 5303 0.1 0.4 1964748 12368 ? S<l 2014 1663:35 /usr/sbin/mysqld --basedir=/usr --datadir=/db/data01 --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/db/logs01/mysql-error.err --open-files-limit=8192 --pid-file=/var/lib/mysql/mysql.pid --socket=/var/lib/mysql/mysql.sock --port=3306
root 12369 0.0 0.0 6376 680 pts/0 S+ 09:05 0:00 grep mysql
# kill -9 3668 5303
# rm /var/lock/subsys/mysql rm: remove regular empty file `/var/lock/subsys/mysql'? y
# service mysql start Starting MySQL (Percona Server).. SUCCESS!

How to start MySQL server from command line on Mac OS Lion?

I installed mySQL on my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preferences, I want to know the instructions to start from command-line.
I do as follows:
After
su root
I start the mySQL server by command-line, but it produces an error as below:
sh-3.2# /usr/local/mysql/bin/mysqld
111028 16:57:43 [Warning] Setting lower_case_table_names=2 because
file system for /usr/local/mysql-5.5.17-osx10.6-x86_64/data/ is case
insensitive
111028 16:57:43 [ERROR] Fatal error: Please read "Security" section of
the manual to find out how to run mysqld as root!
111028 16:57:43 [ERROR] Aborting
111028 16:57:43 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
Simply:
mysql.server start
mysql.server stop
mysql.server restart
Try /usr/local/mysql/bin/mysqld_safe
Example:
shell> sudo /usr/local/mysql/bin/mysqld_safe
(Enter your password, if necessary)
(Press Control-Z)
shell> bg
(Press Control-D or enter "exit" to exit the shell)
You can also add these to your bash startup scripts:
export MYSQL_HOME=/usr/local/mysql
alias start_mysql='sudo $MYSQL_HOME/bin/mysqld_safe &'
alias stop_mysql='sudo $MYSQL_HOME/bin/mysqladmin shutdown'
I like the aliases too ... however, I've had issues with MySQLCOM for start ... it fails silently ... My workaround is akin to the others ... ~/.bash_aliases
alias mysqlstart='sudo /usr/local/mysql/support-files/mysql.server start'
alias mysqlstop='sudo /usr/local/mysql/support-files/mysql.server stop'
As this helpful article states:
On OS X to start/stop MySQL from the command line:
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
On Linux start/stop from the command line:
/etc/init.d/mysqld start
/etc/init.d/mysqld stop
/etc/init.d/mysqld restart
Some Linux flavours offer the service command too
# service mysqld start
# service mysqld stop
# service mysqld restart
or
# service mysql start
# service mysql stop
# service mysql restart
If you installed it with homebrew, the binary will be somewhere like
/usr/local/Cellar/mysql/5.6.10/bin/mysqld
which means you can start it with
/usr/local/Cellar/mysql/5.6.10/support-files/mysql.server start
and stop it with
/usr/local/Cellar/mysql/5.6.10/support-files/mysql.server stop
Edit: As Jacob Raccuia mentioned, make sure you put the appropriate version of MySQL in the path.
Maybe your mysql-server didn't start.
You can try
/usr/local/bin/mysql.server start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
make alias in .bash_profile
alias start_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM start"
alias stop_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM stop"
and if you are trying to run as root use following safe mode
sudo ./bin/mysqld_safe
if you are still having issues starting, a recommended read:
mysql5.58 unstart server in mac os 10.6.5
For me this solution worked on mac Sierra OS:
sudo /usr/local/bin/mysql.server start
Starting MySQL
SUCCESS!
My MySQL is installed via homebrew on OS X ElCaptain. What fixed it was running
brew doctor
which suggested that I run
sudo chown -R $(whoami):admin /usr/local
Then:
brew update
mysql.server start
mysql is now running
If it's installed with homebrew try just typing down mysql.server in terminal and that should be it.
AFAIK it executable will be under /usr/local/bin/mysql.server.
If not you can always run following "locate mysql.server" which will tell you where to find such file.
If you have MySQL installed through Homebrew these commands will help you:
# For starting
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# For stoping
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
MySql server startup error 'The server quit without updating PID file '
if you have installed mysql from homebrew
close mysql server from preferences of mac
ps ax | grep mysql
#kill all the mysql process running
sudo kill -9 pid
which mysql
/usr/local/bin/mysql
Admins-MacBook-Pro:bin username$ sudo mysql.server start
Starting MySQL
. SUCCESS!
Admins-MacBook-Pro:bin username$ which mysql
/usr/local/bin/mysql
Admins-MacBook-Pro:bin username$ ps ax | grep mysql
54916 s005 S 0:00.02 /bin/sh
/usr/local/Cellar/mysql#5.7/5.7.27_1/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/usr/local/var/mysql/Admins-MacBook-Pro.local.pid
55012 s005 S 0:00.40 /usr/local/Cellar/mysql#5.7/5.7.27_1/bin/mysqld --basedir=/usr/local/Cellar/mysql#5.7/5.7.27_1 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql#5.7/5.7.27_1/lib/plugin --user=mysql --log-error=Admins-MacBook-Pro.local.err --pid-file=/usr/local/var/mysql/Admins-MacBook-Pro.local.pid
55081 s005 S+ 0:00.00 grep mysql
On mac Big Sur and MySQL 5.7, I needed to stop/start with:
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
and
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
This answer came from https://coolestguidesontheplanet.com/start-stop-mysql-from-the-command-line-terminal-osx-linux/
In my case, I had downloaded the mysql server and installed it but I didn't click on the run server that showed up on the last installer page.
In order to start my server manually in the terminal (without adding aliases), I used this in the terminal and it works.
Start Server:
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
Stop Server:
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
More info at the link below:
https://www.databasestar.com/start-mysql-server/
111028 16:57:43 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
Have you set a root password for your mysql installation? This is different to your sudo root password. Try /usr/local/mysql/bin/mysql_secure_installation

Mysql install and remove issues

I installed mysql on ubuntu server and i dont know what went wrong...it didnt install a mysql root user so i tried to uninstall and start over and now i cant unistall
i tried this
apt-get remove php5-mysql
apt-get remove mysql-server mysql-client
apt-get autoremove
but when i do
ps aux | grep mysql
root 6066 0.0 0.0 1772 540 pts/1 S 03:21 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 7065 0.0 0.6 58936 11900 pts/1 Sl 03:33 0:00 /usr/sbin/mysqld -- basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid -- socket=/var/run/mysqld/mysqld.sock --port=3306
root 7066 0.0 0.0 2956 688 pts/1 S 03:33 0:00 logger -t mysqld -p daemon.error
root 22804 0.0 0.0 3056 780 pts/1 R+ 04:14 0:00 grep mysql
so i killed the processes and then tried to reinstall like this
apt-get -f install
sudo apt-get install mysql-server mysql-client
sudo mysqladmin -u root -h localhost password 'root'
but i get this
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'#'localhost' (using password: NO)'
im confused..i keep installing and uninstalling mysql and the same result..any ideas
it's possible that mysql is using old config files from your previous installation.
the best way to remove a package is:
sudo dpkg --purge package name
This removes all obsolete config files as well!
The root password is stored in a special "mysql" database. Look in /var/lib/mysql/mysql and see if there is anything there.
In my case, I see:
# ls /var/lib/mysql/mysql
columns_priv.frm help_category.frm ndb_binlog_index.frm slow_log.CSM time_zone_transition.frm
columns_priv.MYD help_category.MYD ndb_binlog_index.MYD slow_log.CSV time_zone_transition.MYD
columns_priv.MYI help_category.MYI ndb_binlog_index.MYI slow_log.frm time_zone_transition.MYI
db.frm help_keyword.frm plugin.frm tables_priv.frm time_zone_transition_type.frm
db.MYD help_keyword.MYD plugin.MYD tables_priv.MYD time_zone_transition_type.MYD
db.MYI help_keyword.MYI plugin.MYI tables_priv.MYI time_zone_transition_type.MYI
event.frm help_relation.frm proc.frm time_zone.frm user.frm
event.MYD help_relation.MYD proc.MYD time_zone_leap_second.frm user_info.frm
event.MYI help_relation.MYI proc.MYI time_zone_leap_second.MYD user_info.MYD
func.frm help_topic.frm procs_priv.frm time_zone_leap_second.MYI user_info.MYI
func.MYD help_topic.MYD procs_priv.MYD time_zone.MYD user.MYD
func.MYI help_topic.MYI procs_priv.MYI time_zone.MYI user.MYI
general_log.CSM host.frm servers.frm time_zone_name.frm
general_log.CSV host.MYD servers.MYD time_zone_name.MYD
general_log.frm host.MYI servers.MYI time_zone_name.MYI
If so, delete that directory and then reinstall.
You can also start mysql in a special no-password mode and then reset the password.