Warning |
---|
title | Make Create a backup! |
---|
|
Before resetting the database make sure that you have a backup of your existing database. |
...
Code Block |
---|
|
# backup command:
mysqldump -u [username] -p[password] -h [server] --verbose [name of database] > [filename.backup.sql] |
...
The username is "nmsprime" in a standard installation. The password was generated at the time of installation and is located in: /etc/nmsprime/env/global.env
on at the line "DB_PASSWORD="
You can use this command to display the password:
Code Block |
---|
|
# Look for the database password:
cat /etc/nmsprime/env/global.env | grep "DB_PASSWORD" |
Note |
---|
Between the -p and the password is no space-character! If your passwort is "hello1234", then this part of the command will be: -phello1234 |
...
Code Block |
---|
|
# drop your existing database: databases and create the databases again
mysql -u root -p[your mysql root password] -e "dropDROP databaseDATABASE nmsprime"
# create the database
mysql -u root -e "; DROP DATABASE nmsprime_ccc; CREATE DATABASE nmsprime CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'; CREATE DATABASE nmsprime_ccc CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';"
# change directory to the artisannmsprime folder
in nmsprime
cd /var/www/nmsprime/artisan
# use php artisan to start the migratemigration-process
php artisan migrate
php artisan module:migrate |
Warning |
---|
|
Expand |
---|
title | If you dont know your MySQL root password |
---|
| If you don't know or loose your root password follow the following steps to reset your MySQL root password: (Source, Source) Code Block |
---|
| # Stop the mysql service:
sudo systemctl stop mariadb.service
# Start a new safe Instance of mysql
sudo mysqld_safe --skip-grant-tables &
# Connect to MySQL
mysql -u root
# Execute the following commands and replace teh password with a secure one:
use mysql;
update user set password=PASSWORD("YOUR-NEW-ROOT-PASSWORD") where User='root';
flush privileges;
exit;
# Start the mariadb service again
sudo systemctl start mariadb
|
|
|
Related: Database Setup