{"id":427,"date":"2023-02-16T18:54:46","date_gmt":"2023-02-16T18:54:46","guid":{"rendered":"http:\/\/joonim.ca\/?p=427"},"modified":"2025-08-20T14:29:34","modified_gmt":"2025-08-20T18:29:34","slug":"ubuntu-how-to-build-lamp-server-3-of-3-mysql","status":"publish","type":"post","link":"https:\/\/waterloobae.com\/blog\/2023\/02\/16\/ubuntu-how-to-build-lamp-server-3-of-3-mysql\/","title":{"rendered":"[Ubuntu] How to build LAMP server 3 of 3 &#8211; MySQL"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">MySQL can be installed as simple as below.<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">$sudo apt install mysql-server<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">mysqld.conf<\/h2>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">$sudo vi \/etc\/mysql\/my.cnf (&lt;- dev server uses this )\n$sudo vi \/etc\/mysql\/mysql.conf.d\/mysqld.cnf  [16.04 | 18.04 | 20.04 | 22.04]\n#bind-address            = 127.0.0.1 (comment out will allow to listen all IP)\nmax_allowed_packet      = 256M\n\nserver-id               = 1\nlog_bin                       = \/var\/log\/mysql\/mysql-bin.log (enable binary log)\nsql_mode = (adding this line disables MySQL Strick Mode) <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">sql_mode can be changed with query as well<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">SELECT @@sql_mode \n-- SET sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'<\/pre>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">$sudo vi \/etc\/mysql\/conf.d\/mysqldump.cnf\n        max_allowed_packet      = 256M\n$sudo \/etc\/init.d\/mysql restart<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Root account setting<\/h2>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">$sudo mysql -u root<\/pre>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">mysql>SET GLOBAL validate_password.policy=LOW;\n\nmysql> CREATE USER 'root'@'%' IDENTIFIED BY 'password';\nmysql> GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;\nmysql> FLUSH PRIVILEGES;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After this, it will be easier to add other users and grant privileges with GUI of MySQL Workbench. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL can be installed as simple as below. mysqld.conf sql_mode can be changed with query as well Root account setting After this, it will be easier to add other users and grant privileges with GUI of MySQL Workbench.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-427","post","type-post","status-publish","format-standard","hentry","category-it-tips"],"_links":{"self":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/comments?post=427"}],"version-history":[{"count":1,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/427\/revisions"}],"predecessor-version":[{"id":491,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/427\/revisions\/491"}],"wp:attachment":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/media?parent=427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/categories?post=427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/tags?post=427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}