Installing mysql Linux Mint

Installing a fresh copy of mysql server on linux was easier than I had hopped it would be.

Steps for a Fresh Installation of MySQL

http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/

1. Adding the MySQL APT Repository
First, add the MySQL APT repository to your system’s software repository list. Follow these steps:

1.1Go to the download page for the MySQL APT repository at http://dev.mysql.com/downloads/repo/apt/. Download the .deb file

1.2 Install the downloaded release package
$ sudo dpkg -i mysql-apt-config_0.8.0-1_all.deb

1.3 Update package information from the MySQL APT
sudo apt-get update

2. Installing MySQL with APT

sudo apt-get install mysql-server

https://dev.mysql.com/doc/refman/5.5/en/linux-installation-native.html

Start/Stop the service

$ sudo  service mysql stop
sudo service mysql status

3. Connect to the server

$ mysql -u root -p

I had a problem exporting/importing my DB from Windows to linux due to Case

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_lower_case_table_names

http://stackoverflow.com/questions/11165944/how-to-change-mysql-table-names-in-linux-server-to-be-case-insensitive

To remove mysql

http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#apt-repo-remove

sudo apt-get remove mysql-server

sudo apt-get autoremove

 – this wasn’t enough, I had to manually  search and delete files/folders

—–
Later Edit:

I have spent half a day trying to remove and then reinstall mysql on linux
I leave here some of the useful links:

1. I could not purge all the mysql packages, especially mysql-common

Removing mysql-common (7.6.2-1ubuntu14.04) ...
Purging configuration files for mysql-common (7.6.2-1ubuntu14.04) ...
update-alternatives: error: no alternatives for my.cnf
dpkg: error processing package mysql-common (--purge):
 subprocess installed post-removal script returned error exit status 2
Errors were encountered while processing:
 mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)


Fix:
https://askubuntu.com/questions/760434/mysql-common-cannot-be-uninstalled

2.To make sure you purge all traces of mysql
https://askubuntu.com/questions/763534/cannot-reinstall-mysql-server-after-its-purge
https://askubuntu.com/questions/773287/how-to-repair-corrupt-package-installation-mysql

to check there are no more packages left:

 
dpkg -l | grep mysql
sudo apt-get remove --purge mysql-\*

Install Maven Linux Mint

UPDATE 2022:
I need to upgrade from mvn 3.6.3 to 3.8 because I needed to use JDK 17

https://linuxize.com/post/how-to-install-apache-maven-on-ubuntu-20-04/#disqus_thread

https://stackoverflow.com/a/71199477/1864614

UPDATE:
– install maven using apt get

$ sudo apt install maven

1. download maven .tar.gz file
2. unpack it into desired location(e.g /opt/apache-maven)
tar xvzf apache-maven-3.3.9-bin.tar.gz
3. Add maven to Environment Variables, info from here
$ sudo gedit /etc/profile

M2_HOME=/opt/apache-maven-3.3.9
export M2_HOME
M2=$M2_HOME/bin

PATH=$PATH:$M2
export PATH

4.Reload your system wide PATH /etc/profile by typing: ‘source /etc/profile’
`Type source $HOME/.profile to load the config into your current shell. `
5. test installation: $ mvn –version