sql如何重命名实例_重命名UbuntuLinux上SQLServer实例
sql如何重命名实例_重命名UbuntuLinux上SQLServer实例sql如何重命名实例
In my previous articles, we installed the SQL Server 2019 CTP 2.1 on Ubuntu Linux. You can follow the below articles to prepare the SQL instance on Linux.
在我之前的⽂章中,我们在Ubuntu Linux上安装了SQL Server 2019 CTP 2.1。 您可以按照以下⽂章在Linux上准备SQL实例。
Sometimes we build the server without worrying about the server name. This might be just for the testing purpose. We give it some name but later we might need to change the hostname of the server. It might be due to the naming convention being followed up in the organization. If we rename the hostname of the instance in the Linux operating system, we might need to worry about the SQL instance as well. By default, SQL instance runs on the hostname of the server. Therefore, if we change the hostname, will there be any impact on the application connecting with the SQL Server with the hostname? If we change the hostname of the server, we will definitely want to change the SQL Server name as well to avoid any confusion.
有时,我们在构建服务器时⽆需担⼼服务器名称。 这可能只是出于测试⽬的。 我们给它起⼀个名字,但是稍后我们可能需要更改服务器的主机名。 这可能是由于组织中遵循了命名约定。 如果在Linux操作系
统中重命名实例的主机名,则可能还需要担⼼SQL实例。 默认情况下,SQL实例在服务器的主机名上运⾏。 因此,如果我们更改主机名,对使⽤该主机名与SQL Server连接的应⽤程序有什么影响? 如果我们更改服务器的主机名,那么我们肯定也会更改SQL Server名称,以免造成混淆。
In this article, we will explore these scenarios
在本⽂中,我们将探讨这些场景
Temporary and Permanent methods to change the hostname of the Ubuntu server
临时和永久⽅法来更改Ubuntu服务器的主机名
Rename SQL Server instance on Ubuntu
在Ubuntu上重命名SQL Server实例
View the system error logs
查看系统错误⽇志
You need to launch the virtual machine configured earlier with SQL instance on it. Launch the termin
al from the applications in Ubuntu server.
您需要启动之前配置了SQL实例的虚拟机。 从Ubuntu服务器中的应⽤程序启动终端。
Run the command ‘hostname’ to get the current hostname. We can see here our current hostname is ‘rajendra-VirtualBox’
运⾏命令“主机名”以获取当前主机名。 我们可以在这⾥看到我们当前的主机名是“ rajendra-VirtualBox”
We can change the hostname of Ubuntu with the two methods
我们可以通过两种⽅法更改Ubuntu的主机名
1. Temporary change
临时变更
2. Permanent change
地砖十大名牌排名
永久变更
在Ubuntu中临时更改主机名 (Temporary change the hostname in Ubuntu )
长白山天池攻略We can change the hostname using the command ‘hostname NewName’. This command needs to be run under the root sudo. We will get below error message if we try to run the command without sudo permission ‘hostname: you must be root to change the hostname’
我们可以使⽤命令“主机名NewName”来更改主机名。 该命令需要在root权限(即sudo)下运⾏。 如果我们尝试在没有sudo权限的情况下运⾏命令,则会收到以下错误消息:“主机名:您必须是root⽤户才能更改主机名”
Let us change the hostname from ‘rajendra-VirtualBox’ to ‘rajendra-SQLLinux’ with the below command.
让我们使⽤以下命令将主机名从“ rajendra-VirtualBox”更改为“ rajendra-SQLLinux”。
$ Sudo hostname rajendra-SQLLinux
$ Sudo主机名rajendra-SQLLinux
Verify the hostname and we can see the new name for the server. You can notice here the command line still says
‘rajendra@rajendra-VirtualBox’
验证主机名,我们可以看到服务器的新名称。 您可以在此处注意到命令⾏仍然显⽰“ rajendra @ rajendra-VirtualBox”
If we try to connect the SQL Server with the new hostname, we get an error message that the server was not found or not accessible. This is due to the instance name is not configured with the SQL Server.
如果尝试使⽤新的主机名连接SQL Server,则会收到⼀条错误消息,指出不到或⽆法访问该服务器。 这是由于没有使⽤SQL Server配置实例名称。
We can connect to the SQL instance using the IP address and the old instance name ‘rajendra-VirtualBox’ in SQL Server Management Studio as shown below. This shows there is no impact on SQL Server even we have changed the Ubuntu hostname.
我们可以使⽤IP地址和SQL Server Management Studio中的旧实例名称“ rajendra-VirtualBox”连接到SQL实例,如下所⽰。 这表明即使我们更改了Ubuntu主机名,对SQL Server也没有影响。
夜里做了美丽的噩梦Let us restart the server using the command ‘shutdown -r’. This command schedules the restart of the server. You can see the message ‘Shutdown scheduled for sat 2018-12-08 08:28:56 IST, use sh
utdown -c to cancel’
让我们使⽤命令'shutdown -r'重新启动服务器。 此命令安排服务器的重新启动。 您可以看到以下消息:``计划于2018年12⽉8⽇星期六停产IST,请使⽤shutdown -c取消''
If we want to cancel the shutdown, we can run the command ‘shutdown -c’
如果要取消关闭,可以运⾏命令'shutdown -c'
陈羽凡前女友
We get the broadcast message at the scheduled time and the system starts the reboot process.
我们在计划的时间收到⼴播消息,系统开始重新启动过程。
Once the server reboot is completed, verify the hostname and we are again back to old hostname ‘rajendra-VirtualBox’
电磁炉能用高压锅吗服务器重新启动完成后,验证主机名,然后我们⼜回到旧的主机名'rajendra-VirtualBox'
Ubuntu中的永久更改主机名 (Permanent change hostname in Ubuntu)
We can change hostname permanently using the GUI as well as the command line mode. Click on the ‘system settings’icon in Ubuntu followed by the details.
我们可以使⽤GUI和命令⾏模式永久更改主机名。 单击Ubuntu中的“系统设置”图标,然后单击详细信息。
在详细信息中,它将打开设备详细信息,您可以看到突出显⽰的设备名称。
街机摇杆设备名称部分有⼀个⽂本框,因此请输⼊新名称并使⽤左上⾓的“ x”图标将其关闭。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。