I used to have mySQL installed in my Rails app and everything was good until I had to install MariaDB (because Sphinx is not compatible with mysql 8).
After deleting the database and recreating it, my I getting this:
rails db:create
Database 'xxx_dev' already exists
Database 'db/test.sqlite3' already exists
but if I start mysql I get this:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.3.13-MariaDB Homebrew
.....
MariaDB [(none)]> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
My Rails app connects to the db using sockets. Apparently, they are not using the same MySql instance (I brew uninstalled everything but MariaDB).
Related
I have a machine that had a running version of MySQL 5.6 used in an apache tomcat Java app. I needed to install WampServer 3.1 for a PHP project which comes with a MySQL 5.7.
I read that I have to change the port of wampserver MySQL to keep everything working as they were. I changed it to 3308 as suggested by wamp.
However, now I can't use mysql through cmd. I reverted back to port 3306, I can now use mysql.
The confusion however is that typing in the cmd:
mysql --version
returns
mysql Ver 14.14 Distrib 5.6.26, for Win64 (x86_64)
but using this command from MySQL:
SELECT VERSION();
returns
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.19 |
+-----------+
1 row in set (0.00 sec)
I tried uninstalling wampserver, but then I couldn't user mysql again. So I re-installed.
I don't want to use MySQL 5.7 with the apache tomcat Java app as it might cause problems with the projects if MySQL version migration is not done properly and it is something that I can't afford now.
If possible, can I keep both wampserver and MySQL 5.6? If not, how can I revert the situation?
Edit: when typing in cmd:
where mysql
it returns
C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe
but the version is as mentioned above 5.7
I am not able to connect a MySQL server remotely.
The connection seems to be ok because with telnet [ip] [port] I get response:
4.1.3b-beta-nt-max▒ <0v '[uZ,? B {efSLa $, Q4N
When executed by command line or by MySQL Workbench 6.3
mysql -u [user] -p -h [host]
I get the same error:
ERROR 2027 (HY000): Malformed packet
It is a mysql client bug, I've searched about it and it is a old auth switch request. Your client it is out of date, using a old protocol communication, now, if it is a Workbench problem too your just the Client, you need to update or downgrade the MySQL Client first and try to run it alone.
Here, it is the same question with a more complete answer:
https://dba.stackexchange.com/questions/135343/server-responds-with-empty-packet-during-session-negotiation-resulting-in-client
And, for the new Auth protocol, on connection phase:
https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase.html
You must upgrade the "old_password" hashed password:
SET PASSWORD FOR 'existinguser'#'localhost' = PASSWORD('existingpass');
So you can login in an "old" MySQL server, using a recent Workbench version
If you need to connect to pre-4.1 MySQL servers from later MySQL versions (5.7+), you will need to use "--skip-secure-auth" option from the client. And the client version cannot be newer than v5.7.4 because this option had been removed in 5.7.5. You can download version 5.7.4_m14 from mysql's archive website. For example,
$ mysql -uuser -p -hserver --skip-secure-auth
I had the same error trying to connect to a MariaDB server with the MySQL client mysql-client. I solved it by installing mariadb-client (that overwrites the mysql binary, so use the same command to connect).
I did face this issue for normal select query. It was weird that when I was using small-case 's' in the query statement, it was giving me the same error. The I figured out that this happens as internally it is trying to retrieve the data from mysql cache.
It was not because of the case of 's' in the select query.
//Returned Error
select * from foo;
//This worked fine
Select * from foo;
//This also worked fine
select SQL_NO_CACHE * from foo;
From this I was able to conclude that it was the issue as it was using Cached data.
I've faced the same issue with latest MySQL Client (>5.7) while trying to connect lower versions of MySQL like 5.1.xx.
To avoid this issue (ERROR 2027 (HY000): Malformed packet), create a user with latest password authentication.
ex:
Login to MySQL 5.1.xx server and execute..
mysql> create user 'testuser'#'xx.xx.xxx.%' identified by 'testuser_Secret1';
Check if you have old_passwords enabled, then disable it for that session.
mysql> show session variables like 'old_passwords';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| old_passwords | ON |
+-----------------+-------+
mysql> set session old_passwords = 0;
mysql> GRANT select on test.* TO 'testuser'#'xx.xx.xxx.%' identified by 'testuser_Secret1';
Verify password that should begin with "*SOMETHING1123SHOWNBELOW3034".
mysql> select user,host,password from mysql.user where user = 'testuser';
+-----------+---------------+-------------------------------------------+
| user | host | password |
+-----------+---------------+-------------------------------------------+
| testuser | xx.xx.xxx.% | *053CB27FDD2AE63F03D4A0B919E471E0E88DA262 |
+-----------+---------------+-------------------------------------------+
Now try logging from MySQL 5.7.xx Client and try to establish a connection to MySQL 5.1.xx server.
[testuser#localhost]# mysql -V
mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper
[testuser#localhost]# mysql -hxx.xx.xxx.xxx -u testuser -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1528853
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2020, 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>
For the people that has this error when the execute the query (not when connecting to DB), the problem is the cache configuration in database.
You can find the bug description here:
https://bugs.mysql.com/bug.php?id=86318
The solution:
disable the cache configuration:
query_cache_limit = 0
query_cache_size = 0
query_cache_type = 0
In the long term there are no negative repercussions, since the latest versions of MySQL no longer support this feature. With little data the cache works correctly, but in large quantities it generates a bottleneck.
More info about the cache removed from mysql 8.0:
https://mysqlserverteam.com/mysql-8-0-retiring-support-for-the-query-cache/
i solved this issue. i was facing this issue in my PHP 7.2. First i created a new user and upgrade it in my script. Then i upgrade PHP 7.2 to 7.3. And it worked. :)
I were install MariaDB on Macbook using brew.
In brew web site. They told.
MariaDB 10.2 is the current stable release of MariaDB. It is built on
MariaDB 10.1 with features from MySQL 5.6 & 5.7, and entirely new
features not found anywhere else.
But when I install and connect with Sequel Pro. On top of program. It show
(MySQL 5.5.5-10.2.6-MariaDB)
I want to make MySQL version to 5.7, Because I want to use JSON column.
How can i solve this issue.
You have got the right version, it is 10.2.6. The prefix 5.5.5 is not to worry about, you can ignore it.
It was added in 10.x versions to allow communicating with old or non-compliant servers/clients/applications which check the version number and refuse to communicate if it's not 5.x.
MariaDB clients strip the prefix, but third-party ones sometimes don't.
That said, please note that MariaDB 10.2.6 does not have JSON column type. It has all the same JSON functions as MySQL 5.7, and a few more, but there is no type, you cannot say CREATE TABLE t (j JSON). The values are supposed to be stored in a regular TEXT/BLOB column.
MariaDB documentation says:
version
Description: Server version number. It may also include a
suffix with configuration or build information.
[...]
From MariaDB 10.2.1, this variable can be set at startup in order to
fake the server version.
If left at its default value, old clients will be presented with a compatible InnoDB version number (e.g.: 5.5.5) despite the variable is internally different:
root#host:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 180
Server version: 5.5.5-10.2.13-MariaDB-10.2.13+maria~xenial-log mariadb.org binary distribution
[...]
mysql> show variables like 'version';
+---------------+------------------------------------------+
| Variable_name | Value |
+---------------+------------------------------------------+
| version | 10.2.13-MariaDB-10.2.13+maria~xenial-log |
+---------------+------------------------------------------+
1 row in set (0.00 sec)
[...]
mysql> show variables like 'innodb_version';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| innodb_version | 5.7.21 |
+----------------+--------+
1 row in set (0.00 sec)
In order to force the version shown to the clients, add this to the [mariadb] section of the server's configuration file:
[mariadb]
version = 5.7.21-10.2.13-MariaDB-10.2.13+maria~xenial-log
The output should be as follows:
root#host:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.7.21-10.2.13-MariaDB-10.2.13+maria~xenial-log mariadb.org binary distribution
[...]
mysql> show variables like 'version';
+---------------+-------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------+
| version | 5.7.21-10.2.13-MariaDB-10.2.13+maria~xenial-log |
+---------------+-------------------------------------------------+
1 row in set (0.00 sec)
I have installed WAMP server2.2 . Installation completed smoothly. but when i tried to access phpmyadmin. It gives error. I changed the password from /wamp/apps/phpmyadmin3.5.1/conf.inc.php.
But now I am facing another error as follows:
Error:-
SQL query: Documentation Edit
SELECT * FROM information_schema.CHARACTER_SETS
MySQL said: Documentation
#1146 - Table 'information_schema.character_sets' doesn't exist
I am new to this so please help me out....I stuck on the same error......
I can't proceed further without phpmyadmin..... Hope somebody help me as early as possible to resolve this error.
Thanks in advance.
Login via command line,
mysql -h myhost -u myusername -p
<ENTER PASSWORD>
run the command
show databases;
sample output:
+--------------------+
| Database |
+--------------------+
| mysql |
| phprojekt |
| test |
+--------------------+
if there is no database information_schema in your output , your mysql server is too old. (Version 4.x, most recent is 5.6 as of 2013). This can be the case, if you try to connect to an old database server in your company which didn't bother to upgrade (happens quite often for many reasons).
Also read this:
Generate INFORMATION_SCHEMA table for MySQL database
(you can't)
I have installed MySql on windows 7 ... issue is i'm unable to get multiple connection to MySql .
If I connect to MySql through command line and at the same time open an other MySql command line client it goes into wait state, as soon as I disconnect the first one later one gets connected.
Because of above issues I'm unable to run tomcat in debug mode as it tries to get more than one connection to MySql in debug mode.
Previously I was using same version of MySql i.e. 5.1 on vista and it was working fine.
when connected with only one MySql Command line "show processlist" results
| 4 | root | localhost:49487 | NULL | Query | 0 | NULL | show processlist
1 row in set (0.00 sec)
and after connnecting with 2nd command line which hangs "show processlist" on the 1st window results
| 4 | root | localhost:49487 | NULL | Query | 0 | NULL | show processlist
| 5 | root | localhost:49518 | NULL | Sleep | 0 | NULL | NULL
2 rows in set (0.00 sec)
I entered following command through command line.
mysql -u root -h localhost -P 3306 -p
it asked me for password and got connected. Then I opened an other command prompt entered the same command it asked for password and hanged. I went back to the previous command line and closed it and the current one got connected. max_connection is 100 in my.ini file and show processlist reutns same result as above.
What is your 'max_connections' setting (show variables like '%max_connections%') and how many connections are currently 'live' on the server (show processlist)?
I'm guessing it's set very low (1 or 2) and between tomcat and your monitor connections you're exceeding the limit.
Raising it would be done via the mysql.ini/mysql.cnf file, wherever it's kept on Windows.
Are you connecting over the network? or a local file socket? You may be locking on the windows equivalent of mysql.sock - not sure if that behavior changed in Win7. Something like:
mysql -u root -h localhost -p 3306
and make sure that my.ini/my.cnf have networking enabled
After too many re installation of Windows I guess i have identified the root cause ... On every fresh installation MySql use to work fine but after a while I use to get stuck with this issue.
The cause was my voip messenger "Wizton" after installing it MySql work fine but when i restart my machine ... same Connection issue.
But wizton was working perfectly fine with Vista Business .. don't no what happens in Windows 7.