Here a list of useful commands to do installations of Atlassian tools in MySQL
Example for CentOS with yum ( install of MySQL client)
- At the command line of your instance, install
wget
:sudo yum -y install wget
- Install the MySQL client on the instance:
sudo yum -y install mysql
Download MySQL Connector/J
Jira connects to a database using a JDBC database connection. The MySQL Connector is the official JDBC driver for MySQL. This example uses version 5.1.46 of the MySQL Connector.
- At the command line of your Jira instance, download the connector:
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz
- Uncompress the
tar
file:tar -xzf mysql-connector-java-5.1.46.tar.gz
- Copy the file to
/opt/atlassian/jira/lib
:sudo cp ./mysql-connector-java-5.1.46/mysql-connector-java-5.1.46-bin.jar /opt/atlassian/jira/lib/.
Starting the MySQL session
This section shows how to create a MySQL user and password and how to create a MySQL database to connect Jira to during the setup process.
- At the command line of your instance, start a MySQL session: (change the IP to your IP…and the port)
mysql -u root -p --host 127.0.0.1 -P 3306
When the session is ready, you see the
mysql
prompt. - Create the database. Substitute
[DATABASE_NAME]
for your database name.CREATE Database [DATABASE_NAME] CHARACTER SET utf8 COLLATE utf8_bin;
- Create a non-root user and set the user’s password. Replace
[USERNAME]
for your username and[PASSWORD]
with your password.CREATE USER '[USERNAME]'@'%' IDENTIFIED BY '[PASSWORD]';
- Grant the user all privileges:
GRANT ALL PRIVILEGES ON [DATABASE_NAME] . * TO '[USERNAME]'@'%'; FLUSH PRIVILEGES;
- Close the MySQL session:
EXIT;
JIRA and MySQL 5.6
JIRA and MySQL 5.7
Confluence and MySQL
Crowd and MySQL
- MySQL Atlassian Official documentation
- Essential Queries in Crowd
- List the last login date of users
- Recover Admin Rights
- Recover the group crowd-administrators
MySQL Import/Export databases
A common use of mysqldump is for making a backup of an entire database:
shell> mysqldump db_name > backup-file.sql
You can load the dump file back into the server like this:
UNIX
shell> mysql db_name < backup-file.sql
The same in Windows command prompt:
mysql -p -u [user] [database] < backup-file.sql
PowerShell
C:\> cmd.exe /c "mysql -u root -p db_name < backup-file.sql"
MySQL command line
mysql> use db_name;
mysql> source backup-file.sql;
By MrAddon