I run mysql.server stop
then
$ mysql.server stop
Shutting down MySQL
.. SUCCESS!
And mysql configuration is like this. It seems to be stopped.
However, I can run mysql -uroot
$ mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.15 Homebrew
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
What is happening ?
I guess that two mysql are installed because I used homebrew to install mysql. If so, how to stop another one ?
if you want to make sure, you could always ps the MySQL process.
Also, you could check if the port to see if it's been occupied by the MySQL process.
I found the reason. I once run brew services start mysql.
So, even if i run mysql.server stop, soon mysql server restarted.
I disabled auto restart by brew services stop mysql
Related
So I have just installed linux and started messing around with apache,php,mysql and I have this error when creating database. I was unable to find an answer so i hope you guys can help me.
max#MaxLNX:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 67
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database firstdb;
ERROR 1006 (HY000): Can't create database 'firstdb' (errno: 13)
Error means that your mysql server doesn't have enough space.
Check the file system size, and remove unwanted software(s),or files.
There may be a permissions issue with the MySQL data directory. You could try setting the permissions as follows (adjust the path to your data directory)
chown -R mysql:mysql /usr/local/mysql/data
reply if it worked
Try using "sudo". On a Linux system, "sudo" means "superuser" and should help you gain access to make a database. Try this in your terminal:
sudo mysql -u root -p
i have install mysql for a mont ago. i use every day without any problem. and now, my mysql very strange. i can login to mysql, and alway succees. but, sometime cannot run a query.
this is the sample of unseccessfull query:
gai#gai-Lenovo-G470 ~ $ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use sps;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
ERROR:
Can't connect to the server
mysql>
I am very confused. how to solve this problem?
This is a common issue, The largest cause is usually just timeout issues, Do you get this error after a large amount of idle time?
If the command returns a large amount of data that is to large it can also cause the issue.
The various causes and fixes are listed HERE Please try the fixes and if you still have issues let us know what you have tried.
mysqld starts properly but i am not able to access it on rhel5, when i enter mysql command it return nothing, but when i enter /usr/bin/mysql it starts properly
[root#192 log]# service mysqld stop
^[[A^[[Stopping mysqld: [ OK ]
[root#192 log]# service mysqld start
Starting mysqld: [ OK ]
[root#192 log]# mysql
^Z
[2]+ Stopped mysql
[root#192 log]# mysql
^Z
[3]+ Stopped mysql
[root#192 log]# /usr/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1912
Server version: 5.1.61-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> \q
any help to fix this issue.
I'm having a really annoying problem to connect to MySQL by Git Bash 2.5 (via Windows on localhost).
Everything works fine trough CMD and Mysysgit.
$ mysql -u root -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.26-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
But, look at this. Git SCM for windows still stuck, blinking the cursor for ever and ever. Have you guys seen this? Anyone can help me?
$ mysql -u root -proot
Warning: Using a password on the command line interface can be insecure.
Thanks in advance.
the solution is provided here:
Git Bash mysql blank
use this winpty before any window command and it works.
winpty mysql -u root -proot
The issue 242 point out:
this is a known problem (see git-for-windows/build-extra/installer):
Some console programs interact correctly with MinTTY only when called through winpty (e.g. the Python console needs to be started as winpty python instead of just python).
If you do not like that, feel free to choose the installer option not to use MinTTY.
Please note also that Git for Windows is not your "Linux on Windows". It really is supporting Git on Windows and not necessarily mysql.
Using mysql in a docker container (like nkratzke/EasyMySQL) would be easier and provide a more manageable Linux environment.
Is there a way to save the connection params(like host, port, username, password, db) to the mysql servers I frequently access as shortcuts?
I am looking for something similar to ssh config for mysql from terminal in ubuntu. preferably with ssh tunneling support as well.
You could use the --defaults-file option combined with an shell alias,
for example:
% cat db01
[mysql]
user=root
password=<your_pwd>
host=<your_host>
% alias my_db01='mysql --defaults-file=db01'
% my_db01
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 5.1.54-1ubuntu4 (Ubuntu)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
So you can create different files with different settings.