Change Microsoft SQL Server Data Location

Change Microsoft SQL Server Data Location

Let’s say you have an existing Microsoft SQL data and want to move it to a different disk or directory. Running the query below shows the logical name and the file location of your schema. SELECT name AS FileLogicalName, physical_name AS FileLocation FROM sys.master_files WHERE database_id = DB_ID('HR'); Existing Location FileLogicalName FileLocation HR C:\MSSQL_DATA\OldPath\HR.mdf HR_log C:\MSSQL_DATA\OldPath\HR.ldf Target New Location FileLogicalName FileLocation HR D:\MSSQL_DATA\MSSQL15.MSSQLSERVER\MSSQL\Data\HR.mdf HR_log D:\MSSQL_DATA\MSSQL15.MSSQLSERVER\MSSQL\Data\HR.0.ldf Steps to move the database files Take the database offline ...

March 28, 2025 · John Pili
How to change MySQL’s root to use mysql_native_password in Ubuntu

How to change MySQL’s root to use mysql_native_password in Ubuntu

In some MySQL installation in Ubuntu. You cannot login as root because it is not configured to use mysql_native_password. In this post, I will teach you how to enable mysql_native_password. Log in to MySQL via terminal with sudo mysql -u root Once inside MySQL, we will need to change the default plugin authentication to mysql_native_password and set a password for root. mysql> ALTER USER root@localhost IDENTIFIED BY 'password'; mysql> exit You can now login in MySQL as root using the password you set. ...

October 8, 2020 · John Pili
MySQL Query – List Records That Don’t Exist From Another Table

MySQL Query – List Records That Don’t Exist From Another Table

Suppose you want to retrieve a list of products that are not in promotion. SELECT * FROM product t1 LEFT JOIN promo_product t2 ON t1.idProduct = t2.product_idProduct WHERE t2.idPromoProduct IS NULL

May 17, 2020 · John Pili