- Project uses MySQL as the database. You can either install MySQL on your local machine or use a Docker container.
- If you want to use a Docker container, you can use the following command to run a MySQL container:
Replace
docker run --name {{mysql_container_name}} -e MYSQL_ROOT_PASSWORD={{mysql_root_password}} -d -p 3306:3306 mysql/mysql-server
{{mysql_container_name}}
with the name you want to give to the container and{{mysql_root_password}}
with the password you want to set for the root user. In our case, we use "admin-panel-mysql-container" as the container name and "password" as the password for the root user. - If you want to install MySQL on your local machine, you can follow the instructions here.
- If you want to use a Docker container, you can use the following command to run a MySQL container:
- If you pass the root password when starting the container, the 3rd and 5th steps won't be necessary.
- When running MySQL container, the following command will give you the initially generated password for the root user:
You can also find the password in the
docker logs {{mysql_container_name}} 2>&1 | grep GENERATED
{{mysql_container_name}}
container's/var/log/mysqld.log
file. - Get into the MySQL container using the following command:
You will be prompted to enter the password for the root user. Enter the password you got in the previous step.
docker exec -it {{mysql_container_name}} mysql -uroot -p
- If you are getting the following error: "ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement", alter the password with the following command:
Replace
ALTER USER 'root'@'localhost' IDENTIFIED BY '{{mysql_root_password}}';
{{mysql_root_password}}
with the password you set for the root user. - Create a new user for your application:
'%' is important here as it will allow the user to connect from any host, otherwise you will get the following error: "Access denied for user '{{admin_panel}}'@'localhost'". We use "newuser" as the username and "password" as the password for the user.
CREATE USER '{{admin_panel}}'@'%' IDENTIFIED BY '{{admin_panel_password}}';
- Grant all privileges to the user:
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%';
- Flush privileges:
FLUSH PRIVILEGES;
- Create a database called
admin_panel
"CREATE DATABASE admin_panel;
-
Notifications
You must be signed in to change notification settings - Fork 0
anitalakhadze/admin-panel
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published