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

КОМЕНТАРІ • 74

  • @pedr9vskcray2102
    @pedr9vskcray2102 8 місяців тому

    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

  • @ethiclesshacker
    @ethiclesshacker 5 років тому +9

    I was going to begin with sql and python and this entire series just helped me a lot. Thanks!

  • @ElliyahuRosha
    @ElliyahuRosha 5 років тому +8

    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

  • @Star-zf8su
    @Star-zf8su 5 років тому +4

    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 😀😀

  • @AungWinHtutGH
    @AungWinHtutGH Рік тому

    Clear explanation. Thank you so much

  • @nunogomes1663
    @nunogomes1663 4 роки тому

    Thanks, been looking for theses for three days

  • @gabenfanboy7471
    @gabenfanboy7471 2 роки тому

    when you already prepared your pi for the video and start panicing a little when he mentions the website

  • @aryanbhatia6992
    @aryanbhatia6992 5 років тому +1

    Great video as always :)

  • @lucasayala1125
    @lucasayala1125 4 роки тому

    Thank you Tim! Awsome playlist

  • @thefsquad7787
    @thefsquad7787 4 роки тому +2

    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;

  • @Max-oj9tp
    @Max-oj9tp 5 років тому +1

    Great series!

  • @quiupu07
    @quiupu07 3 роки тому +5

    Unable to locate package mysql-server
    this will help
    sudo apt-get update

  • @brandonthomas7698
    @brandonthomas7698 3 роки тому

    Thanks so much. Helps a ton!

  • @akutGame
    @akutGame Рік тому +1

    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.

  •  2 роки тому

    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 ?

    • @TheSkux69
      @TheSkux69 8 місяців тому

      Use 'user_name'@'%' which uses the wildcard, but becareful because this increases your attack surface.

  • @hareeshch
    @hareeshch 4 роки тому +3

    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'

  • @lowgn9251
    @lowgn9251 Рік тому

    Great !! Thanks a lot

  • @suyashvashishtha4904
    @suyashvashishtha4904 4 роки тому +1

    hey tim can you make a video on how to link Mysql and Kivy. it will be great ... pleaseeee

  • @sergdonskikh2140
    @sergdonskikh2140 5 років тому +1

    Good day!
    can use windows operating system or only under linux?

  • @alexalbon8274
    @alexalbon8274 4 роки тому

    you are a god

  • @hackwithprogramming7849
    @hackwithprogramming7849 2 роки тому

    that firewall will create an issu for u again if u try to connected it from ssh i dont know why

  • @dabbopabblo
    @dabbopabblo 2 роки тому +1

    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)

    • @pureperoni
      @pureperoni 2 роки тому

      agreed i did not download putty!

  • @GhostGaming-tt9tu
    @GhostGaming-tt9tu 27 днів тому

    i want to find out how i host i on my own device. i dont want to pay someone else.

  • @justicegugu9775
    @justicegugu9775 5 років тому

    Do you have a video for python ?

  • @epicfuturehouse
    @epicfuturehouse 3 роки тому +6

    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

    • @pureperoni
      @pureperoni 2 роки тому

      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' :/

  • @jackaxel1430
    @jackaxel1430 5 років тому

    Tim would you please do some videos about Business intelligence project , like with Microsoft sql server , big up Bro

  • @dennisasamoah2213
    @dennisasamoah2213 5 років тому

    great stuff

  • @Blackest9th
    @Blackest9th Рік тому

    can i do this on a pc🤨

  • @AKHILKumar-kh8rz
    @AKHILKumar-kh8rz 5 років тому

    Tim bro. Do kali linux tutorials

  • @nathanforrest7310
    @nathanforrest7310 4 роки тому

    write ur own cnc and make a mirai botnet

  • @LeleGaming123
    @LeleGaming123 4 роки тому

    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?

    • @thelemonman2271
      @thelemonman2271 3 роки тому

      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.

    • @iniyan7966
      @iniyan7966 3 роки тому

      Dude, have you found any solutions for this? I'm also stuck at this! please reply

  • @davidbaker5932
    @davidbaker5932 3 роки тому

    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.

    • @iniyan7966
      @iniyan7966 3 роки тому

      Dude, have you found any solutions for this? I'm also stuck at this!

    • @pureperoni
      @pureperoni 2 роки тому

      @@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 :/

  • @alphaO27
    @alphaO27 4 роки тому

    Is it possible to host the database on our PC having Ubuntu OS ?

  • @soisauce364
    @soisauce364 4 роки тому

    can you do with other platforms except for linode :D

  • @dpthew
    @dpthew 2 роки тому

    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?

    • @jamieabw4517
      @jamieabw4517 2 роки тому

      did you ever find a solution

    • @lock5299
      @lock5299 Рік тому

      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';

  • @blisard2648
    @blisard2648 4 роки тому

    If you already have a database set up, can you use that database on the linux server?

    • @blisard2648
      @blisard2648 4 роки тому

      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?

  • @TheAmazingpower
    @TheAmazingpower 5 років тому

    Is it possible to use a own server like a raspberry pi for this and using then the similar setup?

    • @taruneshsathish6546
      @taruneshsathish6546 4 роки тому

      not possible it uses mariadb

    • @blakehudson4551
      @blakehudson4551 3 роки тому

      You can install a Ubuntu server on a raspberrypi no problem and ssh in through your local network to mimic this tutorial.

  • @conscientiamstudios
    @conscientiamstudios 2 роки тому

    muchas gracias ¡¡

  • @krsingh.shubham
    @krsingh.shubham 5 років тому

    next video very fast please

  • @sainco3036
    @sainco3036 5 років тому

    thanks.

  • @ytehagiang
    @ytehagiang 3 роки тому

    i can't access

  • @sebase1161
    @sebase1161 2 роки тому

    ... 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

    • @captainfaceroll5868
      @captainfaceroll5868 2 роки тому

      Did you find an answer to this?

    • @sebase1161
      @sebase1161 2 роки тому

      No I sadly did not…

    • @CS-Systems
      @CS-Systems 2 роки тому

      @@sebase1161 i am in the same situation :(

    • @CS-Systems
      @CS-Systems 2 роки тому

      i made this and it works
      sudo mysql
      ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'pasword';

  • @prestonwallitsch8636
    @prestonwallitsch8636 4 роки тому

    I converted an old computer into a Linux server.

  • @michealhall7776
    @michealhall7776 5 років тому

    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

  • @hanhvo2495
    @hanhvo2495 4 роки тому

    what is the purpose of hosting a sql server on linux?

    • @ShivamSharma-kv1yd
      @ShivamSharma-kv1yd Рік тому

      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

    • @ShivamSharma-kv1yd
      @ShivamSharma-kv1yd Рік тому

      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.

  • @etakoma7400
    @etakoma7400 5 років тому

    first

  • @Alphabet_-_
    @Alphabet_-_ 5 років тому

  • @mryarut
    @mryarut 3 роки тому +3

    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!