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.
Related
environment
OS X El Capitan 10.11 , Mysql 5.6.26
What I did
mysql port was 3307 when I installed it. ( I didn't install it using brew.)
I changed the port 3306 to 3306 by editing /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist after using mysql with 3307 port for 6 months well.
I revised <string>--port=3307</string> to 3306.
I tried to stop and It didn't work. So I used following:
sudo kill -9 [PID]
It's killed and didn't start. So I changed the port 3006 to 3007.
I tried to start mysql server with following command and got a error.
sudo /usr/local/mysql/support-files/mysql.server start
ERROR! The server quit without updating PID file (/var/lib/mysql/nhnui-MacBook-Pro.local.pid).
And I found some helpful advices in follwing link.
reference link :
After MySQL install via Brew, I get the error - The server quit without updating PID file
I tried to change ownership of files, checking my.cnf file, checking error log file and all didn't work for me.
Finally, I removed /usr/local/mysql/datamysqld.local.err , /usr/local/mysql/datamysqld.local.pid and rebooted mac.and I can start mysql server.
The Problem
Then, the problem is above tip is not perfect for me.
mysql server was running after restarting mac. I checked it with 'ps-ef | grep mysql'.
Stop and start was success and then it didn't stop it again cause of same error!
Screenshot of the error :
Of course, I did it again (I mean deleting .err , .pid file / rebooting mac / cheking mysql ps / stop - start (well) / stop (got error)) and checked that it has same error.
Here is the error log : /usr/local/mysql/data/mysqld.local.err
Now, mysql server can't stop.
What can I do to solve this?
P.S - If it will be better to reinstall mysql, I should do that.
Make a backup of your system.
Dump your data into text files.
Uninstall everything releated to mySql (a quick Google search will point you to several how-tos)
Reinstall mySql from the package in the .dmg available from mySql website.
You can choose the latest 5.6.x or 5.7.x
Set the mySql root password and you're done.
When things get messy and all you can do is guessing what's the fix it's faster to reinstall given that a package installer is provided for mySql (you don't have to compile it yourself or play with brew/macports).
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.
Fisrt of all, you must know that I am a total newbie, non-coder, graphique designer that will be able to copy/paste any code but don't not assume that I can deduce any code/terminal command whatsoever please: I don't know the syntax.
So, here's my issue: I know there are plenty of issues on the web about this, even here, but all by myself I haven't been able to fix my poblem no matter how many thread I've read. I fear I'll need to be held by the hand through this.
I am trying to get a WordPress installation working locally on my Mac Book Pro running osX El Capitan 10.11. I tried following the instructions in that article: http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/ .
It worked well untill I hit the MySQL section. Since I thought there was an issue with my root password (it ended out that the MySQL install had provided me a temporary pass that I forgot about), I tried uninstalling my MySQL install following these instructions: https://php-built.com/uninstall-mysql-from-os-x-yosemite/ , but after re-installing MySQL I kept getting this error: .. ERROR! The server quit without updating PID file (/usr/local/mysql/data/wks-000353.pid).
So, in a nutshell,
This:
sudo /usr/local/mysql/support-files/mysql.server start
... renders this:
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/wks-000353.pid)
This:
/usr/local/mysql/bin/mysql -v
... renders this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
And this:
sudo /usr/local/mysql/support-files/mysql.server restart
... renders this:
ERROR! MySQL server PID file could not be found!
Help would be highly appreciated!!
I recently upgraded my system to OS X Yosemite and started encountering some issues to connect locally to my Database via MySQL Workbench.
It was mainly classic ones about the PID files and socket, that I managed to find solutions for looking over the web. However one was remaining : "Can't connect to MySQL server on '127.0.0.1' (61) (2003)", and none of the solutions I found on the MySQL website, stackoverflow and other forums were working.
I therefore decided to reinstall MySQL using the dmg file (version for OS X 10.9 though, no version yet available for 10.10). It did not work.
That's why I eventually uninstalled every little piece of mysql that I could and reinstalled a clean version using homebrew. The steps I followed are those ones.
However, this did not work either and here is the error message I got :
$ brew postinstall mysql
==> /usr/local/Cellar/mysql/5.6.21/bin/mysql_install_db --verbose --user=Antoine
Installing MySQL system tables...Unknown suffix '.' used for variable 'server_id' (value '127.0.0.1')
2014-10-20 02:35:05 0 [ERROR] /usr/local/Cellar/mysql/5.6.21/bin/mysqld: Error while setting value '127.0.0.1' to 'server_id'
2014-10-20 02:35:05 0 [ERROR] Aborting
2014-10-20 02:35:05 0 [Note] Binlog end
It makes now a little more sense that MySQL server was not able to connect to 127.0.0.1, but I must say that I'm lost and do not really know where to look anymore. I can't find anything on this error message. I had a look to the mysqld file, but it was useless.
Do you think the issue is linked to OS X Yosemite? Any clue of what I could do from here?
I had the same problem, here the solution:
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/
You only have to start again MySql:
sudo /usr/local/mysql/support-files/mysql.server start
I eventually managed to fix the issue by, in this order :
1/ Upgrading to xcode command line tools 6.1
2/ Following those steps to remove completely MySQL
3/ Restarting my computer
4/ Installing MySQL back with the OS X 10.9 package (dmg file available on mysql website)
5/ Copying the my-default.cnf file to the etc folder : sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
6/ Starting the server the first time with this command in terminal : sudo /usr/local/mysql/support-files/mysql.server start
No PID issue, no socket issue, no connection issue to localhost. Everything's fine now.
I am not able to start MySQL server on Mac OS X 10.4.11. MySQL was installed using Macports. MySQL was running fine until it suddenly died without any obvious reason.
When running "mysql", I get the error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
If I try to start MySQL manually, I get the following error message:
sudo /opt/local/share/mysql5/mysql/mysql.server start
Starting MySQL/opt/local/share/mysql5/mysql/mysql.server: line
159: kill: (636) - No such process
ERROR!
In /etc/mysql/my.cnf I have:
socket = __PREFIX/var/run/mysqld/mysqld.sock
But the path "opt/local/var/run/mysqld/" does not exist on my system.
I tried to change the socket path to "__PREFIX/var/run/mysql5/ mysqld.sock" (which is where the socket is located). Unfortunately, this did not help either.
Owner and Permissions for /opt/local/var/run/mysql5/ are correctly set.
Any suggestions on how to start MySQL again? Thanks for your advice.
I use a Mac too and install MySQL from macports. I have experienced the same WTF moments you describe, and I've had to resort to this solution to restart MySQL:
# launchctl unload /Library/LaunchDaemons/org.macports.mysql5.plist
# launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
That seems wrong, too brute force. But I haven't found a better solution yet. I suggest searching ServerFault.com and see if someone else has a better method. Please post here if you do find something.
#lacopo: Why use macports? Because macports is really picky about dependencies. If you use any macports tools that depend on MySQL, it's easier to install MySQL via macports.