User Tools

Site Tools


mysqladmin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mysqladmin [2016/12/15 11:11] – [Install from source] adminmysqladmin [2022/10/29 16:15] (current) – external edit 127.0.0.1
Line 35: Line 35:
 chown -R mysql.mysql /onec/mysql chown -R mysql.mysql /onec/mysql
 </code> </code>
-  - Step6: Init database<code bash>+  - Step6: copy my.cnf to /etc/my.cnf 
 +  - Step7: Init database<code bash>
 cd /onec/mysql cd /onec/mysql
-scripts/mysql_install_db --user=mysql+scripts/mysql_install_db --datadir=/onec/mysql/data --user=mysql 
 +</code> 
 +  - Step8: Start Server:<code bash> 
 +bin/mysqld_safe --user=mysql & 
 +</code>or start with scripts:<code bash> 
 +# Next command is optional 
 +cp support-files/mysql.server /etc/init.d/mysql.server 
 +/etc/init.d/mysql.server start 
 +</code> 
 +  - Step9: Login to Mysql server<code bash> 
 +mysql -uroot 
 +</code> 
 +  - Step10: Reset password root<code bash> 
 +mysqladmin password 'newpassword'
 </code> </code>
 ==== Installing MySQL on Microsoft Windows Using a noinstall Zip Archive ==== ==== Installing MySQL on Microsoft Windows Using a noinstall Zip Archive ====
Line 55: Line 69:
 bin\mysqld --initialize bin\mysqld --initialize
 bin\mysqld --initialize-insecure bin\mysqld --initialize-insecure
-</code>output: Init database mysql in data directory **d:\\tools\\mysql-5.7.13-winx64\data**. And with option --initialize, we check log **.err** in data directory to see temporary password for root:<code> +</code>output: Init database mysql in data directory **d:\\tools\\mysql-5.7.13-winx64\data**. And with option **--initialize**, we check log **.err** in data directory to see **temporary password for root**:<code>A temporary password is generated for root@localhost: 8mfak!jsyltB 
-A temporary password is generated for root@localhost: 8mfak!jsyltB+</code>With old version:<code bash> 
 +./scripts/mysql_install_db --user=mysql 
 +./bin/mysql_secure_installation -> set password for mysql
 </code> </code>
   - Step5: Start the MySQL server:<code bat>   - Step5: Start the MySQL server:<code bat>
Line 189: Line 205:
 SHOW CREATE PROCEDURE `sp_gold_update_transaction`; SHOW CREATE PROCEDURE `sp_gold_update_transaction`;
 </code> </code>
 +  * change definer to **root@localhost** before import sql from sql dump file
 ==== Create database from script .sql ==== ==== Create database from script .sql ====
 commands:<code bash> commands:<code bash>
Line 381: Line 398:
 </code> </code>
 ==== Query log of mysql server ==== ==== Query log of mysql server ====
-  * [windows]<code>+  * [windows] (You must go to **services.msc** and select service MySQL Server to see the **path of my.ini**)<code>
 [mysqld] [mysqld]
 ....... .......
Line 454: Line 471:
 ===== Tunning Mysql Server ===== ===== Tunning Mysql Server =====
 Before run script check, we need to run automatic all pages of websites for running all queries in mysql Before run script check, we need to run automatic all pages of websites for running all queries in mysql
 +==== MySQL table limit ====
 +https://dev.mysql.com/doc/mysql-reslimits-excerpt/5.7/en/column-count-limit.html
 ==== Run script check ==== ==== Run script check ====
 Download script from https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl and run:<code bash> Download script from https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl and run:<code bash>
Line 688: Line 707:
 </code> </code>
     * step2: Loading this file using:<code bash>     * step2: Loading this file using:<code bash>
-mysql  -f --default-character-set=utf8 -u username -p backup_mysql < backup.sql+mysql  -f --default-character-set=utf8 --routines -u username -p backup_mysql < backup.sql
 </code> </code>
 ==== Use the mysqlhotcopy script ==== ==== Use the mysqlhotcopy script ====
mysqladmin.1481800295.txt.gz · Last modified: 2022/10/29 16:15 (external edit)