I'm a little frustrated at this point, so I had to come for aid to stackoverflow lol I've been stuck trying to setup the dev environment for 3h...
This is what's happening, the new version of mysql doesn't support compatible client-side authentication mechanisms for the new server plugin.
More info here
So at this point I had MySQL installed with version 8.0 and I'm trying to revert it back to 5.7 because none of my node.js projects work locally.
Now, I followed this to uninstall MySQL completely.
and this to install multi version with the difference of instead of writing mysql56 I wrote mysql#5.7 because homebrew/versions/ is deprecated.
So... once I do that I go to the terminal and check:
sudo mysql -v
and I get this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
That is if I remove the current agent (the new version 8.0), if I add it back:
# Start agent for current version of mysql (including on login)
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
then it would show me this:
The older version which is the one I want is already linked:
brew link --force mysql#5.7
now... here is the funny thing, when I type: mysql --version
it says: mysql Ver 14.14 Distrib 5.7.23, for osx10.13 (x86_64) using EditLine wrapper
And when I go to my node.js env. to run a query or something, it says:
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
which is the problem mentioned on the other posts about MySQL versioning.
Can someone lend me a hand please. Thanks guys
Brew was suppoused to give me a nice and quick way to install that version, but I ended up even forgeting what I was developing to troubleshoot MySQL... So I decided to go to the oracle page and download it from there. I made a guide, in case another person has the same problem, to read it go here.
If someone has time and wants to have some fun with brew let me know what's the fix for that :)
Related
I Used Migration Assistant from ios to put my things in another mac.
But, after that, my MySQL Server does not run!
In System Preferences, my computer say:
the mysql server instance is not running
Whats happing?
I try this:
brew services start mysql#5.7
And receive:
Error: Formula `mysql#5.7` is not installed.
I do not know why, but my system automatically renamed the MySQL directory during the migration process.
I identified that the usr/local/mysql/ directory was now called usr/local/mysql-5.7.21-macos10.13-x86_64/
What I did that solved the problem, was to create a symbolic link
sudo ln -s mysql-5.7.21-macos10.13-x86_64 mysql
I rebooted my mac, and everything worked correctly.
you will probably need to identify the new directory name with the command
ls usr/local
I'm new to using database connections with R (under Ubuntu 16.04), and am running into some trouble. Following the documentation I've seen online, I tried something like this:
con <- DBI::dbConnect(RMySQL::MySQL(),
dbname='IFsHistSeries',
host='127.0.0.1')
This got me an error message that read:
Failed to connect to database: Error: Can't initialize character set unknown (path: compiled_in)
From what I was able to find using the google, it seems that RMariaDB is more up-to-date than RMySQL, so I gave that a shot instead:
con <- DBI::dbConnect(RMariaDB::MariaDB(),
dbname='IFsHistSeries',
host='127.0.0.1')
This resulted in an equally-cryptic error message:
Failed to connect: Plugin caching_sha2_password could not be loaded:
So then I tried something really foolish -- installing MariaDB using the instructions at https://downloads.mariadb.org/mariadb/repositories/. There were some dependency problems that managed to completely break MySQL so that now nothing works at all anymore. I'm planning to completely uninstall MySQL and MariaDB and start over from scratch. What I want to know for next time is:
Do I need to install MariaDB? Or will ordinary MySQL work with RMariaDB? (The relationship between the two databases confuses me a little.)
Do I need to do something special when setting up MySQL to make sure that the caching_sha2_password plugin works? I'm worried that this has something to do with the way I initially set up the password for my root user.
Any ideas at all would help a lot. Thanks!
--craig
OK... this seemed to work. First, I removed MySQL and MariaDB and installed 8.0.12 MySQL using the download from https://dev.mysql.com/downloads/mysql/ and followed instructions at https://dev.mysql.com/doc/refman/8.0/en/binary-installation.html.
I uninstalled all of my drivers and just reinstalled unixODBC
sudo apt-get remove unixodbc unixodbc-dev tdsodbc odbc-postgresql libmyodbc libsqliteodbc
sudo apt-get install unixodbc unixodbc-dev
Things went awry before when I installed libmariadbclient-dev. Instead, I ran
sudo apt-get install libmariadb-client-lgpl-dev
This installed the MariaDB client without breaking MySQL. I really don't know what the difference between the two is.
To get rid of the error with the caching_sha2_password plugin, I needed to change the default authentication mode when starting the MySQL server:
sudo ./mysqld_safe --user=mysql --default-authentication-plugin=mysql_native_password &
At this point, I could run
con <- dbConnect(RMariaDB::MariaDB(),
host='127.0.0.1',
user='root',
password='password')
Without any trouble.
I have got installed MySQL by default in CentOS 7. It is allowed to start with Firewall and etc.
But I cannot start it using
sudo /sbin/service mysqld start
Error
...No search file or directory
All links about this subject dont help.
Any clue how to start it?
P.S. I found where is mysqld but when I start it I see many errors.
As I discovered MariaDB was not installed properly.
Once it is installed I could access via mysql.
What can I use instead of mysqldump to extract information from db to any file?
I need to give back my computer and save information from it. Buy when I tried to save data base I had I faced a problem:
$mysqldump5 x -u root > x.150124.sql
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)
In internet people face such a problem because they have new mysql and old mysql dump. And they recommend to install mysql56. My versions looks similar:
$ mysqldump5 --version
mysqldump Ver 10.13 Distrib 5.1.66, for apple-darwin11.4.2 (i386)
$ mysql5 --version
mysql5 Ver 14.14 Distrib 5.1.66, for apple-darwin11.4.2 (i386) using readline 6.2
but nevertheless I tried to install mysql56 using MacPorts (similarly to my previous mysql installation) and failed to do it because of errors py27-setuptools stage. All this problems looks quite complicated to solve and it is not guarantied that new problems wouldn't appear and I need the result quickly.
So I ask if there any other ways to store DB information. I don't really care about "clean solutions" and state of the system afterwards, since it will be reinstalled in any-case.
How about
select ... into ... outfile
here is more info on it...http://dev.mysql.com/doc/refman/5.1/en/select-into.html
edit: even better link http://www.mysqlfaqs.net/mysql-faqs/Data-Back-Up/Export-Data/How-to-use-SELECT-INTO-OUTFILE-statement-to-export-data
The quickest way, which I found is to stop current server:
mysqladmin5 shutdown
and install mysql5.6.22 from dmg package (mysql community server for osx10.9), avoiding mac ports.
After that
/usr/local/mysql-5.6.22-osx10.8-x86_64/bin/mysqldump -u root x > ~/x.150125.sql
did the job.
P.S. I don't accept this answer because it doesn't provide alternative solution for dumping. Therefore I accepted #Jose Martinez despite I didn't used that solution.
NOTE: The full discussion to the answer in this question is in a chat link in the comment section below, above the submitted answers.
The summarized answer is in checked answer.
After meddling with installing the gem for mysql2 and successfully doing that I type
which mysql
and it returns
mysql: aliased to nocorrect mysql
I'm not sure what this means.
Then I type in
mysql --version
and it outputs
mysql Ver 14.14 Distrib 5.5.20, for osx10.7 (i386) using readline 5.1
So I know mysql is installed.
Finally I want to configure a database for my rails app so, from within the correct directory I type:
mysql -u root -p
It asks me for a password and, since there is none, I leave it blank. It outputs this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I've been reading around for a solution but I don't understand any of them. Like finding a file called my.cnf or a folder called etc within the rails framework files...
It's trying to connect over unix sockets instead of tcp/ip. Try adding -h param eg
mysql -h localhost -u root -p
edit: Just read your question a bit closer. "mysql" being installed just means you have a client, not the server itself. Check you have mysqld installed.
mysql --socket=/var/lib/mysql/mysql.sock -u root -p
also read this
Here is what finally allowed me to create a freaking database in my rails apps through terminal after dealing this error.
I downloaded mysql's .dmg 64 bit version from here:
http://dev.mysql.com/downloads/mysql/
and then I followed the instructions in the README file. That was the most important part.
Thanks for the help everyone.
EDIT:
This didn't answer the question entirely for me since mysql stopped working.
After installing .dmg version I had to update the bash_profile file.
Here is where the instructions are:
Should I reinstall Mysql?