Recommended Free Tools
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Fix most MySQL failures on Ubuntu by following the evidence in order: check the systemd service and journal, read MySQL’s error log, classify the failure, then test the correct connection path. A socket error, a TCP listener problem, a filesystem permission failure and an authentication denial require different fixes. Make one change at a time and verify the running listener after every configuration edit.
Start with service state and journal evidence
Do not begin by repeatedly restarting MySQL or editing configuration files. First establish whether the server is running and what systemd recorded when it started, stopped or failed.
- Check the service:
sudo systemctl status mysqlUbuntu also supports
sudo service mysql status. - Read the service journal:
sudo journalctl -u mysql - If the service is stopped and the evidence indicates a transient failure, try a controlled recovery attempt with
sudo service mysql restartor
sudo systemctl restart mysql.servicethen immediately check status and the journal again.
The status output distinguishes an active service from one that exited, while the journal often identifies whether the cause is a configuration error, permission failure, failed shutdown or another startup problem. Capture the first error in time order; later messages are often consequences rather than causes.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
Read the MySQL error log before changing files
MySQL’s own error log is usually the most direct explanation for a failed startup. On Debian-family Ubuntu packages, logs are commonly under /var/log/mysql, but the active configuration determines the actual path. Confirm the configured error-log location before assuming a filename or moving files.
What to look for
- The first fatal message around the failed start, not merely the final systemd summary.
Errcode 13, which indicates that the server cannot access the data directory or one of its contents with the required permissions.- Messages such as Bind on TCP/IP port: Address already in use, which indicate that another process already owns the requested TCP endpoint.
- Unix-socket bind errors, which indicate a collision or inability to create the configured socket.
- Configuration-file parsing or shutdown messages that explain why systemd marked the unit failed.
Reading the log first is a low-risk diagnostic action. Blindly changing ownership, ports or authentication can hide the original evidence and create a second problem.
Classify a startup failure before applying a fix
| Observed evidence | Failure class | First action | Risk and verification |
|---|---|---|---|
Errcode 13 or permission-denied text |
Filesystem access | Verify the configured data-directory path, its parent directories and the service account’s read/write access; check mandatory security controls. | Do not run mysqld as root. Recheck the error log and service status after correcting the confirmed path or policy. |
| Address already in use on TCP or a socket bind failure | Endpoint collision | Identify the process listening on the configured port or using the socket before changing settings. | Changing ports is persistent configuration work. Verify the new listener with ss and test a client connection. |
| Service fails before creating its socket | Daemon startup or configuration | Use systemctl status, journalctl and the MySQL error log to find the earliest fatal message. |
Restart only after understanding the logged error; confirm that the service reaches an active state. |
Service is active but a client receives ERROR 2002 |
Socket-path or connection-method mismatch | Test the Unix socket and TCP explicitly as separate paths. | No server-file change is justified until the failing path is identified. |
| Remote client cannot connect while local TCP works | Bind address, firewall or account host restriction | Check the listening address, firewall path and the account’s User/Host identity. |
Opening a port or broadening a bind address expands exposure; verify from the intended remote network. |
Fix data-directory permissions and security blocks safely
When the error log reports Errcode 13, treat it as a filesystem-access problem. Confirm the datadir value in the active MySQL configuration rather than assuming a package default. Then check ownership and mode bits on the data directory and every parent directory in the path. The MySQL service account must be able to traverse the parents and read and write the files it needs.
Check before changing ownership
- Identify which configuration file is active and read its
datadirsetting. - Inspect the directory and its contents as an administrator, recording the current owner and group.
- Confirm that the service is intended to run as the Ubuntu package’s
mysqlaccount. - Check mandatory security software or policy logs if normal Unix permissions look correct. A security profile can deny access even when owner and mode appear valid.
- Correct ownership or policy only for the confirmed MySQL data path, using the package’s expected service account. Avoid an indiscriminate recursive change across an uncertain path.
Never solve a permission error by routinely starting the daemon as root. That can create root-owned database files, weaken isolation and make the next normal start fail. After a correction, restart the service, inspect the journal and error log, and verify that MySQL can create or update its normal runtime files.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Separate Unix-socket errors from TCP errors
For a connection to localhost, MySQL clients normally attempt a Unix-domain socket rather than TCP. Therefore, ERROR 2002 or “can’t connect through the MySQL socket” does not by itself prove that networking is broken. It can mean mysqld is stopped, the server failed before creating the socket, or the client and server use different socket paths.
Test the socket path
Run the client using the local name and inspect the socket path shown in the client error. Compare it with the socket setting in the active server and client configuration. If the service is inactive, repair startup first; changing a client socket path cannot make a stopped server create its socket.
Force a TCP test
Use the loopback address instead of localhost and specify the configured port:
mysql -h 127.0.0.1 -P 3306 -u your_account -p
Replace 3306 with the configured port when the server uses a custom value. A successful loopback connection with a failed localhost connection isolates the problem to socket selection or socket-path configuration. A failed loopback connection requires checking whether mysqld is listening on TCP, which address it chose and whether the port is correct.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Do not infer authentication success or failure from a socket error. First establish that the client reached a listening server; only then interpret an Access denied response.
Check listeners, bind address and firewall access
Use Ubuntu’s socket inspection tool to see whether MySQL is listening and on which port and address:
Free tools Windows power users keep installed
One-click scans. No signup required.
sudo ss -ltnp | grep -E 'mysql|3306'
Adjust the pattern when using a custom port. The output should match the endpoint you intend to use. No matching listener means the service is not listening on that TCP endpoint, regardless of what the configuration file says.
Understand bind-address
Ubuntu’s packaged configuration commonly places the server settings in /etc/mysql/mysql.conf.d/mysqld.cnf. The bind-address setting controls which local address accepts TCP connections. A loopback-only address permits local clients but prevents connections arriving on another interface. A broader address can enable remote access but increases exposure, so choose the narrowest address that meets the requirement.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
When changing the bind address, edit the intended file or included drop-in, make only that change, save it, and restart:
sudo systemctl restart mysql.service
Then run sudo systemctl status mysql, read sudo journalctl -u mysql, and inspect ss again. Verify the actual listening address rather than assuming that a successful restart applied the edit.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Account for the firewall
A remote connection needs more than a listening socket. The firewall must permit the chosen TCP port on the relevant interface and network path. Check the host firewall and any upstream network control before changing MySQL again. If local TCP works but a remote client times out, the failure is commonly the bind address or firewall path; if the remote client receives an authentication denial, packets reached MySQL and the account settings become the next investigation.
Resolve “Access denied for root@localhost” without weakening security
An Access denied response means the daemon answered and rejected the account, password, host match or authentication method. It is not evidence that MySQL is stopped.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Inspect the account identity and plugin
From an administrative session that can connect, inspect the account’s User, Host and authentication plugin. The same username can have different privileges and authentication rules for different host values. A row for root at localhost is not interchangeable with a row for root at an IP address or wildcard host.
Ubuntu installations may use the auth_socket plugin for local root access. With that method, a matching local system user can authenticate through the Unix socket without entering a MySQL password. Trying a password-based login for that account can therefore produce an access denial even when the password you expect is correct.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteUse a dedicated application account
Applications should use a deliberately configured account whose permitted host, authentication method and privileges match the application’s real connection path. Keep administrative root access aligned with the installation’s intended authentication method instead of casually replacing socket authentication or broadening host matches. If you must alter an account, record the original User, Host and plugin values, make one controlled change, and test from the same socket or TCP endpoint the application uses.
Distinguish wrong host from wrong password
When the error names an account and host, compare that host with the connection method. A local socket attempt commonly maps to localhost; a TCP connection to 127.0.0.1 or another address can select a different account row. Fix the matching account rather than granting privileges to an unrelated host entry.
Change a port or other setting and prove it took effect
Port changes are persistent configuration changes, not runtime guesses. Ubuntu’s package documentation demonstrates changing port in mysqld.cnf, restarting MySQL and verifying the new listener.
- Back up or otherwise preserve the current configuration and note the old port.
- Edit the intended MySQL server configuration file or included drop-in. Change only the required
portvalue. - Restart with
sudo systemctl restart mysql.service - Check
sudo systemctl status mysqland
sudo journalctl -u mysqlfor startup errors.
- Confirm the actual listener with
sudo ss -ltnp | grep -E 'mysql|3306'or a pattern matching the new port.
- Test locally with the new port using
mysql -h 127.0.0.1 -P new_port -u your_account -p, then test remotely only if the bind address, firewall and account host rules are also prepared.
If the service fails after a port edit, restore the last known-good value, restart and re-read the error log. A port change cannot resolve a filesystem denial or a malformed setting, and changing it may only move the collision to another endpoint.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Quick Recap
Practical recovery playbooks
MySQL will not start
- Run
sudo systemctl status mysql. - Read
sudo journalctl -u mysql. - Open the configured MySQL error log and find the earliest fatal entry.
- Classify it as permission, endpoint collision, configuration, shutdown or another service failure.
- Apply only the fix supported by that evidence.
- Restart once and verify status, journal and listener.
ERROR 2002 through the MySQL socket
- Confirm that the service is active.
- Compare the client’s socket path with the server’s configured
socketpath. - Try
127.0.0.1and the configured TCP port. - If TCP succeeds, correct the socket-path mismatch rather than changing firewall rules.
- If TCP fails, inspect
ss, bind address, port and the startup log.
Local login is denied
- Confirm that the error is
Access denied, not a socket or connection refusal. - Identify the exact
UserandHostcombination selected by the connection method. - Check whether the account uses
auth_socketor password authentication. - Use the intended local system identity for socket authentication, or use a separate application account configured for the required method.
Remote login fails
- Prove local TCP connectivity with
127.0.0.1and the configured port. - Use
ssto confirm that MySQL listens on an address reachable from the remote network. - Check the firewall path for that port.
- Inspect the account’s
UserandHostrows and authentication plugin. - Retest from the remote client and record whether the result is a timeout, refusal or authentication denial; each result points to a different layer.
Common troubleshooting mistakes to avoid
- Repeated blind restarts: they do not replace reading the journal and error log and can obscure the first failure.
- Changing several settings together: you lose the ability to identify which edit fixed or caused the problem.
- Assuming
localhostmeans TCP: it normally selects a Unix socket, so it tests a different path from127.0.0.1. - Changing the port before checking listeners: an existing process may own the endpoint, and a new port will not fix its underlying cause.
- Recursively changing an uncertain directory: verify the configured data path and package layout first.
- Running mysqld as root: this bypasses the intended service-account boundary and can leave files the normal account cannot use.
- Opening remote access without account controls: bind address, firewall and account host rules must all agree with the required scope.
- Trusting a configuration edit without verification: restart, inspect status and journal, confirm the listener, and perform a client test.
A repeatable verification checklist
- Service state checked with
systemctl status mysql. - Unit events reviewed with
journalctl -u mysql. - MySQL error-log path confirmed from active configuration and earliest fatal entry read.
- Failure classified before changing files.
- Data-directory ownership and mandatory security controls checked when permissions are implicated.
- Socket and TCP tested separately.
- Listener address and port confirmed with
ss. - Bind address and firewall evaluated for remote access.
- Account
User,Hostand authentication plugin matched to the connection method. - After each edit, MySQL restarted and status, journal, listener and client behavior rechecked.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

