failing to run a specific version of mysql on my mac - mysql

I have two versions of mysql:
~ » brew info mysql nirohayon#Nirs-MBP-2
mysql: stable 8.0.12 (bottled)
Open source relational database management system
https://dev.mysql.com/doc/refman/8.0/en/
Conflicts with:
mariadb (because mysql, mariadb, and percona install the same binaries.)
mariadb-connector-c (because both install plugins)
mysql-cluster (because mysql, mariadb, and percona install the same binaries.)
mysql-connector-c (because both install MySQL client libraries)
percona-server (because mysql, mariadb, and percona install the same binaries.)
/usr/local/Cellar/mysql/5.7.20_1 (323 files, 234.8MB) *
Poured from bottle on 2018-01-09 at 16:39:57
/usr/local/Cellar/mysql/8.0.11 (254 files, 232.6MB)
Poured from bottle on 2018-12-26 at 20:33:05
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mysql.rb
==> Dependencies
Build: cmake ✘
Required: openssl ✔
==> Requirements
Required: macOS >= 10.10 ✔
==> Caveats
when I switch to 5.7.20_1 - i go mysql.server start all good and mysql open the shell.
when I switch to 8.0.11 - i go mysql.server start i get en error:
... ERROR! The server quit without updating PID file
(/usr/local/var/mysql/My-MBP-2.pid).
i dont get it, what do i miss here?

You cannot run two instances of mysql on the same data directory.
The pid file is used to guarantee that only one mysqld process is running at the same time on the same database.
If you want to run both MySQL 5.7 and MySQL 8, you have to define two different data directories.

Related

Install MySQL v8 in Google Colab. Service is not starting. Not recognised

I have been successfully installing and using MySQL V5.7 in Google Colab (with Ubuntu 18.04) for quite some time. However trying to install MySQL V8 has repeated failed. I have used the following sequence of commands ..
!apt update
!apt upgrade
#!wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.11-1_all.deb
!wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
!dpkg -i mysql-apt-config_0.8.*
!sudo apt update
!sudo apt install mysql-server
During the install, I provide the root password and have used both the strong password option as well as the legacy authentication. Everything goes fine upto this point and even the following command
!mysqld --version
returns the correct version
/usr/sbin/mysqld Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
After this things go wrong! The MySQL service should have started but it hasn't
!mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
and when I try to start it, it is not recognised ( neither mysql nor mysqld)
!sudo service mysqld start
mysqld: unrecognized service
in fact, even this fails
!systemctl status mysql
System has not been booted with systemd as init system (PID 1). Can't operate.
What am I doing wrong? or what else should I do? or is it that for some reason, Google Colab with Ubuntu 18.04 does not support MySQL V8
No action required ... just this will do
!apt update > null
!apt -y install mysql-server -V
!/etc/init.d/mysql restart
then check
!mysql --version
mysql Ver 8.0.31-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
earlier this used to show Ver 5.7!
Now, with this we can now use CTE, recursion and Windows functions of v8
Check with sudo service mysql start or sudo start mysql once.
Another thing is that google colab instance might not use the system init system at all. That's why it's resulting in System has not been booted with systemd as init system. Check with the sys-v init system once. Its commands look like service service_name start. The same thing happens when trying to start services in WSL.

How can i remove instance of mysql from brew info mysql

I am trying to remove mysql from my macbook pro to start from fresh.
I have followed guides on how to remove all instances and files of mysql, however if i run
brew info mysql
I still get info pertaining to mysql 8.0 as follows:-
mysql: stable 8.0.12 (bottled)
Open source relational database management system
https://dev.mysql.com/doc/refman/8.0/en/
Conflicts with:
mariadb (because mysql, mariadb, and percona install the same
binaries.)
mariadb-connector-c (because both install plugins)
mysql-cluster (because mysql, mariadb, and percona install the same
binaries.)
mysql-connector-c (because both install MySQL client libraries)
percona-server (because mysql, mariadb, and percona install the same
binaries.)
Not installed
From: https://github.com/Homebrew/homebrew-
core/blob/master/Formula/mysql.rb
==> Dependencies
Build: cmake ✘
Required: openssl ✘
==> Requirements
Required: macOS >= 10.10 ✔
==> Options
--with-debug
Build with debug support
--with-embedded
Build the embedded server
--with-local-infile
Build with local infile loading support
--with-memcached
Build with InnoDB Memcached plugin
--with-test
Build with unit tests
==> Caveats
We've installed your MySQL database without a root password. To secure
it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Analytics
install: 66,127 (30d), 215,889 (90d), 794,987 (365d)
install_on_request: 61,289 (30d), 185,026 (90d), 647,998 (365d)
build_error: 444 (30d)
How can i completely remove this? Thank you for any help!
mysql is already uninstalled. See these lines in the middle of your output:
Not installed
From: https://github.com/Homebrew/homebrew-
core/blob/master/Formula/mysql.rb
Homebrew is fetching this information on mysql's dependencies and usage remotely from GitHub. I do not have mysql installed either and get the same output when I run brew info mysql. If you try running mysql from the command line, you should get -bash: mysql: command not found.

How to install MySQL 5.7.x on Mac OS Sierra

I need to obtain the functionality of MySQL 5.7. I had zend server 9 (first 9 version). After reinstallation of zend server (it doesn't supports upgrade).
- Result: MySQL 5.5 !
May there exist solutions for:
Upgrade mysql inside zend framework?
Install other apache2.4+mysql5.7+php7 developer server?
some other solution.
Requirements:
PHP7.0.8 or later
MySQL 5.7
Apache 2.4 or later
Uninstall your existing version of mysql and install mysql 5.7
mysql.server stop # kill the running process
brew uninstall mysql # uninstall mysql
brew update # update brew
brew install mysql#5.7 # install mysql 5.7
Now you can start mysql.server with /usr/local/opt/mysql#5.7/bin/mysql.server start
Modify your PATH variable in ~/.bash_profile so you can start it with just mysql.server start
# ~/.bash_profile
export PATH="/usr/local/opt/mysql#5.7/bin:$PATH"
mysql.com offers a automatic dmg installer, which I find I have the most success with. It typically installs in /usr/local/mysql so you may want to try deleting any other installations you have on your system first.
You can download it here:
https://dev.mysql.com/downloads/mysql/
As for apache and php I find that I typically stick with the ones preloaded into os x, you can There are a number of articles out there on how to active these, but I believe its just a matter of uncommenting the php LoadModule line in /etc/apache2/httpd.conf
#LoadModule php5_module libexec/apache2/libphp5.so
and then starting apache in terminal with the apachectl command.
I installed https://dbngin.com/
Then after that i went to /usr/local
Then I saw a folder name for each of the MySQL versions I had installed using dbngin
Then after that I added it to path. Then that was it.
echo 'export PATH="/usr/local/path-to-mysql/bin:$PATH"' >> ~/.zshrc
You know, after MySQL is uninstalled and reinstalled via homebrew, it will prompt: 1. Upgrade to macOS 10.13; 2. Upgrade to Xcode 9.2.
If you don't want to upgrade the system or Xcode version, then request the MySQL official website to download:
https://downloads.mysql.com/archives/community/
The MySQL version suitable for macOS 10.12 ranges from 5.7.17 to 5.7.23.

Upgrade/Update from mariadb 5.5 to 10

Recently MariaDB 10 became stable.
MySQL 5.6 features were added to 10 release. I need to use some new features, so I'm interested:
Has anybody upgraded from MariaDB 5.5 to 10 on production server?
What is the upgrade path (simply changing mariadb repo to 10 will work?)?
Is the transition smooth?
We have recently been through that exact upgrade, also on CentOS. We experienced no trouble at all with any of our databases, all using the InnoDB engine. I have enclosed our internal upgrade how-to, this may save you some time and show you which path we took.
This guide assumes you are running the AMD64 versjon og CentOS 6.
Create a yum repo file for MariaDB and name it /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
// The signing key value is 0x1BB943DB.
Uninstall current MariaDB server and client. If yum was used to install them, use:
yum remove mysql MySQL-server MySQL-shared MySQL-shared-compat
This should uninstall all packages depending on MariaDB/MySQL, and consequently requires you to reinstall php-mysql as described below. Any other packages depending on MySQL will also have to be reinstalled, so keep an eye out for this.
Install MariaDB
yum install MariaDB-server MariaDB-client
Reinstall PHPs MySQL lib
yum install php-mysql
Start MariaDB, update data files and restart Apache
service mysql start
mysql_upgrade
service httpd restart
Consider rebooting to test that all works as desired.
Upgrade from version 5.5 to 10.0.12 was very smooth.
All user databases and local accounts were automatically restored after the upgrade..
+-----------------+
| ##version |
+-----------------+
| 10.0.12-MariaDB |
Note: You might need to restart the CentOS host if you notice a connection error:
If you configured your root access to MySQL/MariaDB with a password, you need to use the -p option when you want to use mysql_upgrade.

Does installing MySQL with homebrew include the Workbench and GUI (is it preferred to install native)?

Does installing MySQL with homebrew include MySQL workbench and GUI as if you were to run the Native installer (to be able to start and stop services)? I am trying to decide whether it is better to install using homebrew or with native.
homebrew mysql does not contain mysqlworkbench. Mysqlworkbench is another recipe that it is not exactly in homebrew but in homebrew cask (manager for GUI installs).
For GUI installs and 'other licence' installs there is a homebrew related package manager called homebrew cask.
You can find the caskroom recipes from homebrew,
$ brew search mysql
automysqlbackup
mysql ✔
mysql++
mysql-cluster
mysql-connector-c
mysql-connector-c++
mysql-sandbox
mysql-search-replace
mysqltuner
homebrew/php/php53-mysqlnd_ms
homebrew/php/php55-mysqlnd_ms
homebrew/versions/mysql51
homebrew/versions/mysql56
Caskroom/cask/mysqlworkbench
homebrew/php/php54-mysqlnd_ms
homebrew/php/php56-mysqlnd_ms
homebrew/versions/mysql55
Caskroom/cask/mysql-utilities
Caskroom/cask/navicat-for-mysql
but for install them you need to install cask.
brew tap caskroom/cask
brew cask search mysql
brew cask install mysqlworkbench
The workbench is installed in /opt so unless the installer makes an alias to Applications you are not going to find it easily.
NOTE: As of March 2018, the brew installer does make an alias to the Applications folder, so no further action is required.
If you are unable to see it in the Applications folder, you should follow the following:
In my installation the mysqlworkbench was not aliased to /Applications, but in the workbench folder there is a symlink to the Application folder so it is easy to create the link yourself.
$ ll /opt/homebrew-cask/Caskroom/mysqlworkbench/6.3.6
total 224
lrwxr-xr-x 1 pmg staff 14 31 Jan 11:55 Applications -> /Applications/
drwxr-xr-x 3 pmg staff 102 10 Dec 14:55 MySQLWorkbench.app
-rw-r--r--# 1 pmg staff 107640 10 Dec 14:55 background.tiff
make the alias
cd /opt/homebrew-cask/Caskroom/mysqlworkbench/6.3.6/
ln -s MySQLWorkbench.app Applications
You can run the application now from Apps
The Homebrew install does not include Workbench. The download and install of Workbench on OSX is pretty painless (a download and copy - no installer).
Here is some nice info on using Homebrew to install mysql http://blog.joefallon.net/2013/10/install-mysql-on-mac-osx-using-homebrew/
First of all you need to know which versions are available for MySQL:
brew search mysql
You get to know know the versions as it will display after execution of the above command. For example I get this in console: mysql#5.6. There may be multiple versions, so choose accordingly.
Then execute the below command:
brew install mysql#5.6
After installing MySQL, start the services of mysql using the below command:
brew services start mysql#5.6
After the service has started, install mysqlworkbench using the below command:
brew cask install mysqlworkbench
To update the current MySQL installation:
brew upgrade mysqlworkbench