{"id":14884,"date":"2011-05-16T14:02:25","date_gmt":"2011-05-16T12:02:25","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=14884"},"modified":"2011-05-16T14:02:25","modified_gmt":"2011-05-16T12:02:25","slug":"mysql-prompt","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2011\/05\/16\/mysql-prompt\/","title":{"rendered":"MySQL prompt"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>I&#8217;ve been using MySQL for quite a few years by now, but only today I learned that it is possible to define MySQL prompt. \u00a0As per <a href=\"http:\/\/blogs.linux.ie\/kenguest\/2011\/04\/20\/adding-colour-to-your-mysql-prompt\/\">this blog post<\/a>, all it takes is a couple of lines in .my.cnf file with something like:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;mysql]\r\n\ufeffprompt=&quot;\\u@\\h (\\d)&gt; &quot;\r\n<\/pre>\n<p>That alone will help to prevent a gadzillion of destructive mistakes when you think that you are working with one database, when, in fact, you are working with a totally other. \u00a0On top of that, the blog post suggests using <em>rlwrap<\/em> tool, with which one could add some colors to the prompts as well.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>I&#8217;ve been using MySQL for quite a few years by now, but only today I learned that it is possible to define MySQL prompt. \u00a0As per this blog post, all it takes is a couple of lines in .my.cnf file with something like: &#x5B;mysql] \ufeffprompt=&quot;\\u@\\h (\\d)&gt; &quot; That alone will help to prevent a gadzillion &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2011\/05\/16\/mysql-prompt\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">MySQL prompt<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,133,62],"tags":[1559,3066,74],"keyring_services":[],"class_list":["post-14884","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-sysadmin","category-technology","tag-databases","tag-mysql","tag-tips"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":26687,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/09\/14\/mysql-php-and-integrity-constraint-violation-1062-duplicate-entry\/","url_meta":{"origin":14884,"position":0},"title":"MySQL, PHP and &#8220;Integrity constraint violation: 1062 Duplicate entry&#8221;","author":"Leonid Mamchenkov","date":"September 14, 2016","format":false,"excerpt":"Anna Filina blogs about an interesting problem she encountered with when working on a PHP and MySQL project: MySQL was complaining about \u201cIntegrity constraint violation: 1062 Duplicate entry\u201d. I had all the necessary safeguards in my code to prevent duplicates in tha column. I gave up on logic and simply\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7745,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/08\/02\/migrating-from-microsoft-access-to-mysql\/","url_meta":{"origin":14884,"position":1},"title":"Migrating from Microsoft Access to MySQL","author":"Leonid Mamchenkov","date":"August 2, 2004","format":false,"excerpt":"Many people are migrating still migrating from Microsoft Access to MySQL. I came across a freeware program that can simplify the process. It can migrated all database structure, data, and meta data (indexes, etc). Download links and screenshots are here. If all that stops you now is your ASP code,\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27380,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/03\/02\/mysql-8-is-coming\/","url_meta":{"origin":14884,"position":2},"title":"MySQL 8 is coming","author":"Leonid Mamchenkov","date":"March 2, 2017","format":false,"excerpt":"OpenSource.com covers the upcoming release of the MySQL 8. What happened to 6 & 7? Years ago, before the Sun Microsystems purchase of MySQL AB, there was a version of MySQL with the number 6. Sadly, it was a bit ambitious and the change of ownership left it to wither.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24,"url":"https:\/\/mamchenkov.net\/wordpress\/2002\/03\/08\/mysql-password-recovery\/","url_meta":{"origin":14884,"position":3},"title":"MySQL password recovery","author":"Leonid Mamchenkov","date":"March 8, 2002","format":false,"excerpt":"It often happens so that administrator's password for MySQL is lost or forgotten. The easiest way to fix the problem is to open \/var\/lib\/mysql\/mysql\/user.MYD in hex editor and replace the encrypted string near \"localhost root\" with spaces. Then mysql service should be restarted, and that's it.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23757,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/03\/24\/mysql-in-star-topology\/","url_meta":{"origin":14884,"position":4},"title":"MySQL in star topology","author":"Leonid Mamchenkov","date":"March 24, 2015","format":"link","excerpt":"MySQL in star topology","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12790,"url":"https:\/\/mamchenkov.net\/wordpress\/2010\/07\/23\/on-scalability-of-mysql\/","url_meta":{"origin":14884,"position":5},"title":"On scalability of MySQL","author":"Leonid Mamchenkov","date":"July 23, 2010","format":false,"excerpt":"Anyone who says that MySQL is not scalable has no idea. \u00a0Facebook is one of the examples for a large deployment of MySQL: How big is Facebook\u2019s Internet infrastructure? Facebook VP of Technology Jeff Rothschild provided some details in a panel at the recent MySQL user conference. Rothschild says Facebook\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/14884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=14884"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/14884\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=14884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=14884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=14884"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=14884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}