How to Host a MySQL Server on Linux
Вставка
- Опубліковано 7 лют 2025
- In this video I will be showing how to host a MySQL server on a linux server. This involves downloading and installing MySQL on the linux server and configuring it so that it can be connected to remotely. In the last parts of the video I will demonstrate how to connect to the server from python code.
Thanks to linode for sponsoring this video! Take advantage of a free $20 credit towards a linode with the code "TWT19".
linode.com/tec...
Download Putty: www.putty.org
Playlist: • Python MySQL Tutorial ...
Process and Linux Commands
Once you have logged into the linux server run the following:
sudo apt-get install mysql-server
sudo mysql_secure_installation utility
sudo ufw enable # allows remote access
sudo ufw allow mysql
sudo systemctl start mysql
sudo systemctl enable mysql
cd to /etc/mysql/mysql.conf.d/mysqld.cnf
change bind to 0.0.0.0
sudo systemctl restart mysql # restart mysql
Now obtain your PUBLIC IPV4 Address from the machine you want to connect with.
mysql -u root -p
create database Test
Get ip address
GRANT ALL ON fooDatabase.* TO fooUser@'PUBLIC IPV4 ADDRESS' IDENTIFIED BY 'some password'
Then you can connect to the linux servers ip address as the host attribute for the MySQL connection. Use the username you set in the last command and the password.
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.....
📸 Instagram: / tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-rusci. .
📂 GitHub: github.com/tec...
🔊 Podcast: anchor.fm/tech...
💵 One-Time Donations: www.paypal.com....
💰 Patreon: / techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
Tech With Tim
Python Tutorials
MySQL Tutorial
How to host a MySQL server on linux
Host mysql server on linux
Linux install mysql
Remote connection to mysql
#Python #MySQL #MySQLLinuxServer
the sheer quality of this videos is just amazing, i've watched you entire series and its 100% the best material on youtube on python/sql subject, good job
I was going to begin with sql and python and this entire series just helped me a lot. Thanks!
Yesterday I too the day to learn SQL, and today I went all over this playlist.
This was just perfect for me, I'm good to go :)
Elliyahu from Jerusalem
Really really!!! Thanks a lot........You are helping us a lot by providing so much nicely explained lessons.......... I Finally learned how to connect to database with Python 😀😀
Clear explanation. Thank you so much
Thanks, been looking for theses for three days
when you already prepared your pi for the video and start panicing a little when he mentions the website
Great video as always :)
Thank you Tim! Awsome playlist
For peaple that get error's do this
CREATE user 'YOURUSERNAME'@'YOURHOST' IDENTIFIED BY 'YOURPASSWORD';
GRANT ALL ON YOURDATABASE.* TO 'YOURUSERNAME'@'YOURHOST;
-----------------
Example->
CREATE user 'test'@'localhost' IDENTIFIED BY 'password12345';
GRANT ALL ON animaldatabase.* TO 'test'@'localhost;
Great series!
Thanks :)
Unable to locate package mysql-server
this will help
sudo apt-get update
Thanks so much. Helps a ton!
But why does he have a root user with pwsd? Im so stupid... I get the error: ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.
Bro a question, (13:33) , u said to input the ip of the machine from where we want to connect to the server, what if i dont want to lock the login to a unique ip ?
Use 'user_name'@'%' which uses the wildcard, but becareful because this increases your attack surface.
while running the command 'mysql -u root -p' if you get the error 'ERROR 1698 (28000): Access denied for user 'root'@'localhost'' trying running using a sudo like 'sudo mysql -u root -p'
Great !! Thanks a lot
hey tim can you make a video on how to link Mysql and Kivy. it will be great ... pleaseeee
Good day!
can use windows operating system or only under linux?
you are a god
that firewall will create an issu for u again if u try to connected it from ssh i dont know why
dont go out of your way to download putty just for a simple ssh connection if your using linode, the web console is terrible but you can just copy and past the ssh command they give you into the windows cmd and instantly have access (after putting your password in ofc)
agreed i did not download putty!
i want to find out how i host i on my own device. i dont want to pay someone else.
Do you have a video for python ?
If you have the error of not being able to access your VServer with SSH again, then execute this command:
sudo ufw allow ssh
you have to allow ssh connections to the firewall that is set up in this tutorial
i have literally just stopped at that point in the video and thought 'this is a bad idea im gonna get locked out of my sever' :/
Tim would you please do some videos about Business intelligence project , like with Microsoft sql server , big up Bro
great stuff
can i do this on a pc🤨
Tim bro. Do kali linux tutorials
write ur own cnc and make a mirai botnet
hey man...after i do ufw enable, the firewall is enabled and i cant ssh to the remote system anymore, i have logged off... now its giving me a headache...from what i gathered, i need a direct connection to straighten this out, any thoughts?
You may have already solved this, but in case any else has the same issue running ' sudo ufw allow ssh ' after enabling the firewall resolve this.
Dude, have you found any solutions for this? I'm also stuck at this! please reply
Enabling the firewall without first allowing the SSH port locked me out of my own droplet when I tried to log in again after this tutorial.
Dude, have you found any solutions for this? I'm also stuck at this!
@@iniyan7966 this video is bad i cant believe he has done this! i was about to do this with a sever that contains a load of my website information and data :/
Is it possible to host the database on our PC having Ubuntu OS ?
can you do with other platforms except for linode :D
Everything worked great until GRANT ALL ON test.* etc... I get error 1064 although I did everything exactly like in the video, any ideas why?
did you ever find a solution
Try running this instead - it worked for me.
CREATE USER 'username'@'ip address' IDENTIFIED BY 'your password';
GRANT ALL ON test.* TO 'username'@'ip address';
If you already have a database set up, can you use that database on the linux server?
is it just a matter of instead of creating a new database, just putting - database = "already_created_database" in the python code when setting up a connection?
Is it possible to use a own server like a raspberry pi for this and using then the similar setup?
not possible it uses mariadb
You can install a Ubuntu server on a raspberrypi no problem and ssh in through your local network to mimic this tutorial.
muchas gracias ¡¡
next video very fast please
thanks.
i can't access
... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters. can somone help me
Did you find an answer to this?
No I sadly did not…
@@sebase1161 i am in the same situation :(
i made this and it works
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'pasword';
I converted an old computer into a Linux server.
Thanks Tim you are the man. I'm thinking about making UA-cam videos do you have a email I'd like to ask you a few questions about marketing a channel
what is the purpose of hosting a sql server on linux?
Make API which may provide JSON output. JSON is supported by many languages unlike sql database.
Hosting SQL online keep SQL active and API ready to use. The basic necessities for automation. Hope this answers
Also you get static public IP. same IP you configure once across multiple applications. Home n/w offers DHCP and making that static and publically available is not always possible because it relies on your ISP.
first
sick video man! learned a ton, however how could I use this for an app for example as everytime I download the app on a new device the IP that tries to acces the database obviously changes? Thanks!