Skip to main content

Posts

Showing posts with the label Mysql

Reset Wordpress Admin Via MySQL DB

Here are step by step to reset wordpress password if forgot the password. Make sure you have access to the databases.  mysql> use wordpress; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +-----------------------+ | Tables_in_wordpress   | +-----------------------+ | wp_commentmeta        | | wp_comments           | | wp_links              | | wp_options            | | wp_postmeta           | | wp_posts              | | wp_term_relationships | | wp_term_taxonomy      | | wp_termmeta           | | wp_terms              | | wp_usermeta           | | wp_users              | +-----------------------+ 12 rows in set (0.00 sec) mysql>  Generate a New Password Hash: WordPress uses a salted MD5 hash for passwords. You can generate a new password hash. Here is example python script import bcrypt def generate_wordpress_hash(password):     # Generate a random salt and h

Write docker file and create a container with os debian and mysql installed

 Below is a simple example of a Dockerfile to create a Docker container with Debian OS and MySQL installed. This example uses the official MySQL Docker image available on Docker Hub. # Use the official Debian base image FROM debian:latest # Set environment variables for MySQL ENV MYSQL_ROOT_PASSWORD=root_password ENV MYSQL_DATABASE=mydatabase ENV MYSQL_USER=myuser ENV MYSQL_PASSWORD=mypassword # Install MySQL server RUN apt-get update && apt-get install -y \     mysql-server \     && rm -rf /var/lib/apt/lists/* # Configure MySQL to allow remote connections RUN sed -i 's/127.0.0.1/0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf # Expose the MySQL port EXPOSE 3306 # Start MySQL server on container startup CMD ["mysqld"] # To build the Docker image, run: # docker build -t debian-mysql . # To run the container, execute: # docker run -d -p 3306:3306 --name mysql-container debian-mysql Please note that setting a root password for MySQL in this manner is not rec

Solusi lupa password wordpress admin

 berikut adalah catatan solusi jika lupa password admin wordpress cara ini melalui db mysql, pastikan dulu sudah bisa akses ke db mysql dengan db wordpress dan password username yg benar kemudian jalankan perintah berikut: mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | wordpress          | +--------------------+ 2 rows in set (0.00 sec) mysql> use wordpress; Database changed mysql> SELECT ID, user_login, user_pass FROM wp_users; +----+------------+------------------------------------+ | ID | user_login | user_pass                          | +----+------------+------------------------------------+ |  1 | nasohi     | $**********&&&&* | +----+------------+------------------------------------+ 1 row in set (0.00 sec) Contoh dibawah akan mengubah password menjadi  this1SPassw0rD mysql> UPDATE wp_users SET user_pass = MD5('this1SPassw0rD') WHERE ID=1 LIMIT 1; Query OK, 1 row affected (0