I am a bit desperate. I've tried to install mysql in Raspbian Strectch but I get instead mariadb.
I've followed this tutorial step by step but I still get mariadb installed.
https://dbahire.com/how-to-install-mysql-server-on-debian-stretch/
pi#raspberrypi:/ $ sudo mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
What can I do?
Why do you want MySQL over MariaDB? They are largely interchangeable so you can probably just use MariaDB, most MySQL things work well with it.
Related
I have MariaDB (foobar_db) running in local environment in Docker. I have a SQL file some_sql_dump.sql that I want to run on this database. This is what I tried:
docker exec -t container_id_here mysql -u root -prootpass foobar_db < some_sql_dump.sql
This takes me into MariaDB's monitor:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.4.13-MariaDB-1:10.4.13+maria~bionic mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [foobar_db]>
It seems like using the arrow (<) to pass in input from some_sql_dump.sql did not work correctly. Why did the arrow not work, and how can I make it run the SQL from the file?
I have just used the "--interactive , -i" option and it seems to work.
$ docker exec -i {container_id} mysql -u root -prootpass foobar_db < some_sql_dump.sql
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
I was using MySQL server 5.7 and for another project, I needed to install MariaDB.
I have followed official instructions Mariadb official download page
after the install MySQL login in showing me following output
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 46
Server version: 10.4.6-MariaDB-1:10.4.6+maria~bionic mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> exit
how do I make both servers running up? maybe by different ports/ any identifier.
Plan A:
Be sure they are in separate directories.
Be sure to have separate my.cnf config files.
Use different port numbers. (Perhaps leave the existing one as 3306, then pick a bigger number for the second install.)
Plan B:
Put the second install in a VM. There are still details to iron out of "hostname" and port. Possibly the hostname of the VM cannot be "localhost", thereby forcing use of TCP/IP.
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.