RJ博客

MySQL连接优化

本文目录

在使用MySQL时,可能会遇到程序连接本地MySQL数据库速度很慢,这很有可能是使用了localhost作为连接时的主机名。注意啦,是数据库就在本地哦,如果是远程连接MySQL慢可能是网络原因。


解决方法:


方法一:ping一下localhost,如果ping出来是::1,那就是解析到了IPV6的ip了,把hosts文件中增加127.0.0.1 localhost,将localhost解析为127.0.0.1。如果有::1 localhost那就去掉。


方法二:在MySQL配置文件中的[mysqld]下增加skip-name-resolve,然后重新启动MySQL服务即可。此方法使用后,连接MySQL时的主机名就不能用域名和localhost了,只可以用ip地址。


如果以上方法还是很慢,建议重新配置运行环境或重新安装系统。


相关推荐

发表评论

  • 欢迎评论

  • Hey, we are running a black friday special on leads.. The entire USA (93 million records for $79) The entire Australia (8 million records for AUD 99) The entire South African Database (4 Million records for R1000) The entire UK (16 million records for £49) Or take all 152 countries for $99! Instant access and delivery. Visit CompanyLeads.org Regards, Stanley

  • Hey, are you starving to find the right leads? CompanyLeads.org has launched a limited time offer that covers all the countries in the world. At $149 once-off you get access to over 300 million leads categorized, targetted and ideal. Instant access and delivery. Visit CompanyLeads.org Regards, Joey

  • We have a one time limited offer. 366,295,395 Leads for $20! BusinessLeads101.com!

  • Hi , Who would I contact at your company that handles ordering your logo products, t-shirts, and promotional items? For over 20 years we have been creating and supplying our clients with all their custom logo merchandise. We can put your logo onto anything including: -Custom Printed T-shirts / Hoodies -Pens -Mugs -T-shirts -Bags -Banners -Table Covers -Key chains -USB flash drives ---plus 350,000 other items! We also offer PPE items such as hand sanitizer and masks. Are there any upcoming projects that you need logo items for? Thanks in advance for your time. Regards, Silas Custom Branded Product Specialist

  • Hey! Get all the leads you ever need. We have a special offer running BusinessLeads101.com. Stop paying Facebook and Linkedin and get a once-off solution. Regards, Agueda

  • jRAUKFsPNWflJzq

  • dfKqgiPoYMZEBC

  • Hello. It is with sad regret to inform you we are shutting down. We are selling our entire leads database 366,295,395 Companies / Executives. for $179 All countries are $99 and you can buy the entire world 165 countries for $179. www.SunDataGroup.one

  • QGW9PD3Q4DIX3SYWXF www.google.com I have a small question for you

  • Hello. Need leads for your business? We have a limited offer where we sell almost 400 million executives around the world in 165 countries for $299. Or you can buy your country individually for $99. www.SunDataGroup.one

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha.com, RuCaptcha.Com, AntiGate (Anti-Captcha), DeathByCaptcha, etc. Interested? Just search in Google "XEvil" for more info You read this - then

  • XEvil-最好的验证码求解工具,具有无限数量的解决方案,没有线程数限制和最高精度! XEvil5.0支持超过12.000类型的图像验证码,包括ReCaptcha,Google captcha,Yandex captcha,Microsoft captcha,Steam captcha,SolveMedia,ReCaptcha-2和(是的!!!)ReCaptcha-3了。 1.) 灵活: 您可以调整非标准验证码的逻辑 2.) 简单: 只需启动XEvil,按1按钮-它将自动接受来自您的应用程序或脚本的验证码 3.) 快: 0,01对于简单的验证码秒,关于20..40秒的ReCaptcha-2,约5。..8秒的ReCaptcha-3 您可以将XEvil与任何SEO/SMM软件,密码检查器的任何解析器,任何分析应用程序或任何自定义脚本一起使用: XEvil支持大多数知名的反验证码服务 API: 2Captcha, RuCaptcha, AntiGate.com (Anti-Captcha.com), DeathByCaptcha, etc. 有兴趣吗? 只需在YouTube"XEvil"中搜索即可获取更多信息 你读这个-那么它的工作原理! ;) XEvil.Net 问候, Lolitywoupt2787

  • We at BestLocalData.com has been hit badly by Covid-19 and as a result BestLocalData.com is shutting down. We provided the best data to companies to find their right customer base, we don't want other companies to go down the same path we went and go out of business. As a result we are providing our data till the end of the week at the lowest possible prices. BestLocalData.com

  • Hello, It is with sad regret to inform you that BestLocalData.com is shutting down. We have made all our databases for sale for a once-off price. Visit our website to get the best bargain of your life. BestLocalData.com Regards, Garfield

  • Hello from SendBulkMails.com, We have a special limited offer for you to send unlimited emails. We allow non-permission based emails and you won't ever get blocked. We also buy your domain for you and give you a clean IP and setup your DNS records. Check us out on SendBulkMails.com

  • Hello, BestLocalData.com has a special package you get any group of databases for $49 or $249 for all 16 databases and unlimited emails for a year(Domain, IP, Dashboard included). You can purchase it on BestLocalData.com and see samples if you are interested.

  • Do you need more clients? We have amazing databases starting at $9.99 until the end of the Month! Visit us at StarDataGroup.com

  • Use SendBulkMails.com to run email campaigns from your own private dashboard. Cold emails are allowed and won't get you blocked :) - 1Mil emails / mo @ $99 USD - Dedicated IP and Domain Included - Detailed statistical reports (delivery, bounce, clicks etc.) - Quick and easy setup with extended support at no extra cost. - Cancel anytime! Regards, www.SendBulkMails.com

  • It is with sad regret to inform you StarDataGroup.com is shutting down. Fire sale going on! Any group of databases listed below is $49 or $149 for all 16 databases in this one time offer. You can purchase it at www.StarDataGroup.com and view samples. - LinkedIn Database 43,535,433 LinkedIn Records - USA B2B Companies Database 28,147,835 Companies - Forex Forex South Africa 113,550 Forex Traders Forex Australia 135,696 Forex Traders Forex UK 779,674 Forex Traders - UK Companies Database 521,303 Companies - German Databases German Companies Database: 2,209,191 Companies German Executives Database: 985,048 Executives - Australian Companies Database 1,806,596 Companies - UAE Companies Database 950,652 Companies - Affiliate Marketers Database 494,909 records - South African Databases B2B Companies Database: 1,462,227 Companies Directors Database: 758,834 Directors Healthcare Database: 376,599 Medical Professionals Wholesalers D

  • It is with sad regret to inform you StarDataGroup.com is shutting down. Fire sale till the 7th of Feb. Any group of databases listed below is $49 or $149 for all 16 databases in this one time offer. You can purchase it at www.StarDataGroup.com and view samples. - LinkedIn Database 43,535,433 LinkedIn Records - USA B2B Companies Database 28,147,835 Companies - Forex Forex South Africa 113,550 Forex Traders Forex Australia 135,696 Forex Traders Forex UK 779,674 Forex Traders - UK Companies Database 521,303 Companies - German Databases German Companies Database: 2,209,191 Companies German Executives Database: 985,048 Executives - Australian Companies Database 1,806,596 Companies - UAE Companies Database 950,652 Companies - Affiliate Marketers Database 494,909 records - South African Databases B2B Companies Database: 1,462,227 Companies Directors Database: 758,834 Directors Healthcare Database: 376,599 Medical Professionals Wh

  • 好屌