Problem is-
While installing Yamaha USB MIDI driver,
it get stuck at a 25001 error, no device connected, in spite of the keyboard is connected and installation fails.
And everyone is giving suggestions beyond context.
Are you getting that error, too? If so, can you provide more information, in particular the model of keyboard?
The 25001 error can occur for a few different reasons, so the solution that worked for one person might not work in your case.
For some people, they might be using the wrong type of USB cable-- that is, a USB 3 cable-- and that might be causing the problem. Switching to a USB 2 or USB 1.1 cable might solve their problem.
For others, they might be using the right type of cable, but it might be too long, which might cause the problem. Switching to a shorter cable might solve their problem.
For others, they might be using the right type of cable, and it might be short enough, but it might have a broken wire inside due to being wound too tightly abd unwound too many times-- too much wear and tear, too much bending of the wires inside the cable until one or more of them breaks. Switching to an undamaged cable might solve their problem.
And for others, they might be trying to install the wrong driver, or the wrong version of the right driver. Some Yamaha keyboards have an audio-over-USB feature which requires using the Steinberg USB driver rather than the Yamaha USB-MIDI driver. Or it might be the right driver but the version being installed is for the wrong operating system, such as for Windows XP instead of Windows 10, or 32-bit instead of 64-bit.
And if the keyboard doesn't even have USB-MIDI and is being connected to the computer using a non-Yamaha USB-MIDI interface, then the Yamaha driver won't work with it anyway, because the driver needs to be the one that's designed for the USB-MIDI interface.
So it isn't a "one answer fits all cases" type of problem, which is one reason why it can be so frustrating for the user to try to find the correct-for-their-case solution to it.