How to install mysql shell in centos 7 - mysql

i'm trying to set up mysql shell in Centos 7 by following the instructions in this document
https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install-linux-quick.html
i was able to set up the repo for centos 7 but when i try to install, it seems it's installing the mysql-shell for Centos 8 and i'm getting what i believe is a gcc error even if gcc is installed because of it
i then tried installing from their direct downloads page here https://dev.mysql.com/downloads/shell/ by picking Red Hat Enterprise Linux 8 / Oracle Linux 8 (x86, 64-bit), RPM Package and installing yum localinstall but while the installation was successful, the mysql shell still didn't come up
has anyone been able to install mysql shell in centos 7? how did you go about it?

You're using the wrong command for it. Use this instead:
[developer#web01-compute ~]$ mysqlsh
Then once you're in you can type:
\c 127.0.0.1
To connect to any locally running instances of mysql. Or just use the ip address of whatever mysql instance you are trying to connect to. Be prepared to give password for it.
\sql
lets you begin typing normal sql commands.

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.

Will the MAMP(PRO) mysql conflict with brew install mysql on macos

I'm trying to install a clean mysql on my macos Sierra. As I already installed brew, I decided to use this stackoverflow answer. Nevertheless, before installation, these pre-install check is done:
I have already checked the bash line with mysql command, and found no such command.
I brew info mysql, and found mysql Not Installed.
However, I still have doubt over that I might not have a clean installation environment. So I use the find / -name mysql -type d to search all the directory for mysql. And I've found there are mysql included in MAMP. As these line writes:
/Applications/MAMP/db/mysql
/Applications/MAMP/db/mysql/mysql
/Applications/MAMP/Library/lib/perl5/site_perl/5.22.0/darwin-2level/auto/DBD/mysql
/Applications/MAMP/Library/lib/perl5/site_perl/5.22.0/darwin-2level/DBD/mysql
I've installed MAMP about two years ago. Now I just want to learn mysql in command line rather than one-click environment like MAMP. And I wonder if I can install the mysql using brew to get a generic mysql environment if I don't uninstall the MAMP? And WHY is that the MAMP will/will not affect the mysql installed from brew?
Not really, they wont' be on conflict.
Mamp use another port, and brew use default mysqm port 3306
Mamp use this foder: /Applications/MAMP/Library/bin/mysql
Brew use his own folder : /usr/local/Cellar/mysql/(version...)
with brew you don't need use path to execute bin files, just type 'mysql -uroot -p' on the terminal.

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.

Installation and running mysql 5.6 in Ubuntu 14.04

I need to setup mysql5.6 server in ubuntu 14.04(32 bit). I downloaded mysql-server_5.6.19-1ubuntu14.04_i386.deb-bundle.tar from official site. I installed mysql using below commands:
dpkg -i mysql-5.6.16-debian6.0-x86_64.deb
for server, coummunuty etc which all comes in the tar file one by one. Steps I followed are mentioned in this site:
http://dev.mysql.com/doc/refman/5.6/en/linux-installation-debian.html
I can see myconf.cnf file also.
But when I executed the command to start mysql service it gave me error. Error: mysql service uynrecognized.
Kindly tell me what went wrong with my installation.
Thanks

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.